Saving array of data to Firebase with Javascript/NodeJs -
i need save data database @ index. tried pulling data down with
var people = []; ref.once('value', function(snapshot) { snapshot.foreach(function(childsnapshot) { var id = childsnapshot.key; childsnapshot.foreach(function(lastsnapshot) { var qr = lastsnapshot.val(); people.push({[id]: qr}); return true; }); }); my firebase structure:
people: { jake: "231", jessica: "412", rachel: "112" } then splice list , add @ index:
index = 1; // add person after jessica people.splice(index, 0, person); i want sync firebase set , update don't allow format this.
how can this? thanks!
Comments
Post a Comment