You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nicolas Garnier
86e42faba1
|
9 years ago | |
---|---|---|
.. | ||
README.md | 9 years ago | |
env.json | 9 years ago | |
index.js | 9 years ago | |
package.json | 9 years ago |
README.md
Import Data to Big Query
This template shows how to keep the number of child nodes in a Firebase database below a given number. This can be used to limit the number of lines of a chat history or logs.
Cloud Function Code
See file index.js for the code.
The dependencies are listed in package.json.
Sample Database Structure
As an example we'll be using a simple logs database structure:
/functions-project-12345
/logs
/key-123456
text: "User signed in."
/key-123457
text: "Error: Could not connect to Database"
Trigger rules
Below is the trigger rule for the addtobigquery
function making sure it's triggered when a new log entry is added.
"functions": {
".source": "functions",
"addtobigquery": {
"triggers": {
"database": {
"path": "/logs/$logid"
}
}
}
}