how to push multiple data to different parents in a single request in firebase
var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
// Generate a new push ID for the new post
var newPostRef = ref.child("posts").push();
var newPostKey = newPostRef.key();
// Create the data we want to update
var updatedUserData = {};
updatedUserData["user/posts/" + newPostKey] = true;
updatedUserData["posts/" + newPostKey] = {
title: "New Post",
content: "Here is my new post!"
};
// Do a deep-path update
ref.update(updatedUserData, function(error) {
if (error) {
console.log("Error updating data:", error);
}
});
Also in JavaScript:
- background image with styled components
- jquery get element by class and data attribute
- declare * angular jquery
- react native modal
- express js list all routes
- Converting from HttpClient to Native HTTP
- lodash npm
- discord js stats command
- javascript date difference in months
- js data object length
- on click jqueyr
- promp node js
- how to push values in array
- event.target.name in setstate
- create function javascript
- ckeditor change value
- javascript pass by reference
- get form response with javascript
- jquery table header agnostic of scroll
- unpack list javascript
- get json data when we get error code in axios
- check if js string begin with word
- node get value from map
- jquery ajax responseText