假设我将此最小数据库存储在Cloud Firestore中.我怎么能检索的名字subCollection1和subCollection2?
rootCollection {
aDocument: {
someField: { value: 1 },
anotherField: { value: 2 }
subCollection1: ...,
subCollection2: ...,
}
}
Run Code Online (Sandbox Code Playgroud)
我希望能够只读取ID aDocument,但只有字段出现在我get()的文档中.
rootRef.doc('aDocument').get()
.then(doc =>
// only logs [ "someField", "anotherField" ], no collections
console.log( Object.keys(doc.data()) )
)
Run Code Online (Sandbox Code Playgroud)