Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

realtime database push multiple values

const array = [{ title: 'one' }, { title: 'two' }, { title: 'three' }]

var updates = {};
array.map(item => {
     var newPostKey = firebase.database().ref().child(`boards/${boardId}/containers/`).push().key;
     updates[`boards/${boardId}/containers/` + newPostKey] = item;
});
firebase.database().ref().update(updates);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #realtime #database #push #multiple #values
ADD COMMENT
Topic
Name
2+5 =