Answers for "realtime database push multiple values"

0

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);
Posted by: Guest on July-15-2021

Code answers related to "realtime database push multiple values"

Browse Popular Code Answers by Language