Home Firestore Query Android WhereEqualTo
Reply: 1

Firestore Query Android WhereEqualTo

Kevin La Delfa
Kevin La Delfa Published in 2018-02-14 06:27:00Z

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

Alex Mamo
Alex Mamo Reply to 2018-02-14 07:32:26Z

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.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309141 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO