イムそれが呼び出す方法がわからないとみとめオブジェクトをプッシュする、しかし、私はちょうどのようにデータをプッシュしたい:は良いことがあります:Firebaseは、キー
.push()
{
'{this_should_be_a_key}' : {
name : '',
items : {
'{this_should_be_a_key}' : {
title : ''
}
}
}
}
は今、私のような何かを使用することにより私が持っている
ref.push({
'name' : ''
}).then(function(snapshot) {
let key = snapshot.key;
ref.child(key+'/items').push({
title : ''
});
}).catch(function(err) {
console.log(err);
});
この約束と2回押す、任意の簡単な方法またはその可能性が一度だけプッシュ?以下のような...
ref.push({
'name' : '',
'items' : {
'{this_should_be_a_key}' {
'title' : ''
}
}
}).then(function(snapshot) {
alert('done');
}).catch(function(err) {
console.log(err);
});
感謝を! 、 'ref.push()。key'これは一意のIDになりますか? – l2aelba
まあ、かなり:https://gist.github.com/mikelehen/3596a30bd69384624c11 – cartant