Reputation: 618
When querying with where() in Firestore, it succeeds when I give the values one by one, but when I export a list, nothing returns.
Successful sample code:
List temp = example.sharedPreferences.getStringList(example.userList);
Firestore.instance.collection('example').where('id', whereIn: ['77','30','71','13']).snapshots(),
Failed sample code:
List temp = example.sharedPreferences.getStringList(example.userList);
Firestore.instance.collection('example').where('id', whereIn: [temp]).snapshots(),
What can I do in this situation?
Upvotes: 2
Views: 1710
Reputation: 80914
temp
is already a list therefore in the failed sample code, you don't need to use []
, just do the following:
List temp = example.sharedPreferences.getStringList(example.userList);
Firestore.instance.collection('example').where('id', whereIn: temp).snapshots()
Upvotes: 4