Talking about querying on Firestore, I found collection().where()
function.
It would be a great help, if I could get some good information about the syntax of how does this .where()
function works.
Found something like this in a tutorial.
const userExist = db.collection('data').where('users', 'array-contains', user.email);
How does the code above work? Help would be appreciated.
CodePudding user response:
The query in your question will return all documents that exist in the data
collection, where the array property called users
contains an email that is equal with what user.email
returns.