R
R
Ruslan Shashkov2015-09-29 19:25:56
JavaScript
Ruslan Shashkov, 2015-09-29 19:25:56

How to create a new Firebase object via $firebaseArray without loading other childs?

The following script will normally create a new entry in /history, but at the same time, if you look at the console, the web socket will download all the other entries, since $firebaseArray(ref) is just for this. But how to make it so that you can simply create and write a new object as an array child? Is it really necessary to create such a query for this, so that, according to its conditions, not a single record in the array is loaded?

var ref = firebaseService.getReference().child('history'),
    history = $firebaseArray(ref);

history.$add({
    title: 'New item',
    time: new Date().getTime()
});

history.$save();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question