hansemannn / titanium-firebase-database

Use the Firebase Realtime Database SDK in Axway Titanium 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is "path" variables in FirebaseDatabase.getReference().childByAutoId() method

amo222lpatil opened this issue · comments

i am using your below code in appcelerator

var FirebaseCore = require('firebase.core');
FirebaseCore.configure();
var FirebaseDatabase = require('firebase.database');

// Inserting values in firebase database
var fdRef = FirebaseDatabase.getReference().childByAutoId({
	path: 'user'
});

fdRef.setValue({
	username: 'username',
	email: 'test@example.com',
	password: 'ABCXYZ',
	timestamp: FirebaseDatabase.getFirebaseServerTimestamp()
}, function(e) {
	Ti.API.info('Value written, snapshot: ' + JSON.stringify(e, null, 4));
});

// Fetching values from Firebase database

var userRef = FirebaseDatabase.getReference({
	path: 'user',
	observableEvents: [FirebaseDatabase.DATA_EVENT_TYPE_CHILD_ADDED, FirebaseDatabase.DATA_EVENT_TYPE_VALUE]
});

userRef.addEventListener('value', function(e) {
	Ti.API.info('DATA_EVENT_TYPE_VALUE, snapshot: ' + JSON.stringify(e, null, 4));
});

userRef.addEventListener('add', function(e) {
	Ti.API.info('DATA_EVENT_TYPE_CHILD_ADDED, snapshot: ' + JSON.stringify(e, null, 4));
});

But i didnt get What value should i assign to "path" variables in FirebaseDatabase.getReference().childByAutoId() method.
Does it is collection name in firebase project ?