Firestore Query Android WhereEqualTo

Kevin La Delfa Source

What I want to do is look up all the documents that "usuarios" equals "amigos". The problem is that "amigos" is a list. I want you to bring all the documents of all the Strings(amigos) that you find on that list. But I get this error:

UNIMPLEMENTED: Unsupported FieldFilter value type: 9

CollectionReference collectionReference = db.collection("eventos");

collectionReference.whereEqualTo("usuario", amigos).limit(15).orderBy("hora", Query.Direction.DESCENDING).get().addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {

enter image description here

javaandroidfirebasegoogle-cloud-firestore

Answers

answered 3 months ago Alex Mamo #1

You get that error because you are trying to filter your data using an unsupported type filter. Your amigos filed is an ArrayList and cannot be used to filter data. The second argument of the whereEqualTo() method can never be an ArrayList. You can filter only by supported data types. Unfortunatelly, the ArrayList is not suppoerted by Firestore.

Please see also Query.whereEqualTo(String field, Object value):

Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be equal to the specified value.

comments powered by Disqus