Firebase.setData()

Write data to your Firebase instance with the Set method.

This will parse your data from a string into a JSON object. Writing data with .Set() will overwrite all existing data on the child node. This is best used for new or replacement data. To add data to your child node without overwriting, use .push(). You can find out more about which write option to use here: https://www.firebase.com/docs/web/guide/saving-data.html

Usage

Hover over inputs/exits for more info.

var Firebase = require('machinepack-firebase');


// Write data to your Firebase instance with the Set method.

Firebase.setData({

firebaseURL: 'your-firebase-database.firebaseio.com',

write: '*',

child: 'users',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

firebaseURL required

The reference URL for your Firebase dataset.

'your-firebase-database.firebaseio.com'
write required

The dataset you wish to write to your Firebase instance, in JSON form.

child

The child of your reference URL which you wish to write to.

'users'

Exits

error

An unexpected error occurred.

success

OK.