google firestore as backend for one of my apps and I have a document with an array as it's field which basically stores references to other documents.
When I fetched the document data and checked if a document reference is in the array, I always get a result that it doesn't exist in the array, even if its in there.
//The below codes logs as 'false'
console.log([db.doc('collectionName/docId')].includes(db.doc('collectionName/docId')))
console.log(db.doc('collectionName/docId') === db.doc('collectionName/docId'))
I guess there is something unique with each document reference object. If this is the case then how can I check if a document reference exists in an array of document references?
We'd have to see the code for the db.doc function
Обсуждают сегодня