This is my Tasks Collection where assignee field refers to users collection
This is the output i am getting when i fetch tasks collection
答案 0 :(得分:0)
//SAVING...
let ref = db.collection('nameOfCollection').doc('documentId').ref
//Focus ".ref" at the end
db.collection('otherCollection').doc('otherDocumentId').set({ nameRef:ref })
//READING...
db.collection('otherCollection').doc('otherDocumentId').ref.get().then(res=>{
//this "res.data().nameRef"
//it is the same as
//"db.collection('nameOfCollection').doc('documentId').ref"
})
我不知道我是否可以帮忙,但不幸的是我做了我能做的。 对不起,我仍然不会说英语。