Query in firestore to check item inside a document

0

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

Because it is in an array , inside my document, I do not know how to mount the query .

    
asked by anonymous 06.06.2018 / 21:37

1 answer

1

I believe that Firebase does not have the ability to execute such a query.

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

So your query would look like:

db.collection("pessoas")
    .whereEqualTo("idUsuario", "Y1e8racPvbhr5RHuxkQv")
    .whereEqualTo("preso",true);
    
06.06.2018 / 22:28