Seeking a way to search through all documents in collection a that have a reference to a specific document in collection b.
Despite my efforts, I couldn't find a solution here or on Google :/
This is what I tried in my service class:
getAsFromB(id) {
var refB = this.firestore.collection("/collection_b").doc(id);
console.log(refB);
return this.firestore
.collection("/collection_a", (ref) => ref.where("refB", "==", refB))
.snapshotChanges();
}
However, I encountered the following error: Unsupported field value: refB = custom Object but log says refB is looking good AngularFirestoreDocument
https://i.sstatic.net/Wul1s.png
Can someone point out what I may have missed or where I went wrong?
Appreciate any help in advance!