📅  最后修改于: 2022-03-11 14:58:21.193000             🧑  作者: Mango
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);