📌  相关文章
📜  实时数据库推送多个值 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:21.193000             🧑  作者: Mango

代码示例1
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);