Firebase IN - GogoVega/node-red-contrib-firebase-realtime-database GitHub Wiki

The Firebase IN node connects to a Firebase RealTime Database and subscribes to data in the specified path. This is an event listener that will send a payload when the configured event is triggered.

Below is the list and description of fields to configure for this node:

Database

Select or add a config-node. The config-node is your database to which the listener will subscribe. Learn more about the role of config-node.

Listener

Below is the list and description of listeners:

Value

It is triggered once with the initial data and again every time the data changes. The sent payload contains all data at that location (path), including child data.

Child Added

Unlike Value which returns the entire contents of the location, Child Added is triggered once for each existing child and then again every time a new child is added to the specified path. The sent payload contains the new child's data.

Child Changed

This event is triggered any time a child node is modified. This includes any modifications to descendants of the child node. The sent payload contains the updated data for the child.

Child Moved

This event is used when working with ordered data, read more here.

Child Removed

This event is triggered when an immediate child is removed. The sent payload contains the data for the removed child.

[!NOTE] v0.6 allow to define the listener dynamically.

Sort Data?

Use Query Constraint to sort and order your data?

Path

The path to add the listener to.

[!NOTE] v0.6 allow to define the path dynamically.

Output

Choose whether you want the payload type to be either automatic (string | boolean | number | array | object | null), JSON object or JSON string.

Message Properties

Below are the properties of the incoming and outgoing message:

Input

  • listener: the listener to set.
  • constraints: an object containing the constraint(s) to apply to the query.
  • topic: the path of the data to add/modify. By default 'topic'.

Output

  • payload: contains your query data from the database.
  • previousChildName: contains the key of the previous child, by sort order, or null if it is the first child.
  • priority: contains the priority of the data.
  • topic: contains the path where the data comes from.

Read more about message properties.

Next Step