【发布时间】:2023-04-03 19:48:01
【问题描述】:
所以我在这里想要实现的是这样的数据结构:
id: "BgaI9c5gHB666MpwXPqb"
name: "Rhys Clay"
"pushkey1" : true,
"pushkey2" : true
正如您在上面看到的,我想将文档中的按键存储为平面对象。
这是我目前的代码:
let contactsRef: DocumentReference = this.afs.doc(`contacts/${contactId}`).ref;
batch.set(contactsRef, {
'name' : contact.name,
'number' : contact.number,
'nativeId' : contact.nativeId,
'id' : contactId,
groupdId : true
});
batch.commit();
]
但是这样我会得到类似的东西:
id: "BgaI9c5gHB666MpwXPqb"
name: "Rhys Clay"
groupdId : true,
任何帮助表示赞赏。
【问题讨论】:
-
我现在实际上认为最好将其存储为平面对象。更新我的代码
标签: angular firebase google-cloud-firestore angularfire2