简体   繁体   中英

Firestore Query Android WhereEqualTo

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM