• 1
name Punditsdkoslkdosdkoskdo

Firestore: Query by item in array of document

I have a document "user" which has a key called "photos". Here is an array of strings being saved, namely the IDs of the "photo" documents.

I want to query "user" by this "photos" field: I want all users who have this ID in the "photos" property.

Is this possible through firestore?

Added 'array-contains' query operator for use with .where() to find documents where an array field contains a specific element. 5.3.0

Update: also available in @google-cloud/firestore:

Update 2

Update 3 now available in Admin Node.js SDK v6.0.0

  • 0
Reply Report