Query in firestore to check item inside a document

Asked

Viewed 322 times

0

I’m using the Firebase Firestore and I need to mount a *query that checks the following data as pointed out in the following figure:

Estrutura do Resultado

Because he’s in one array, inside my document, I don’t know how to assemble the query.

1 answer

1


I believe that Firebase is unable to execute such query.

However, to solve the problem, I suggest you create a collection "People" at the root and put there those same attributes. Also add the attribute "idUsuario".

So your query would be:

db.collection("pessoas")
    .whereEqualTo("idUsuario", "Y1e8racPvbhr5RHuxkQv")
    .whereEqualTo("preso",true);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.