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 557d006393 Add bigquery-import sample. 9 years ago
..
README.md Add bigquery-import sample. 9 years ago
env.json Add bigquery-import sample. 9 years ago
index.js Add bigquery-import sample. 9 years ago
package.json Add bigquery-import sample. 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"
        }
      }
    }
  }