问题
I want to be able to query my collections for document Ids, and then get a list of documents. For Example: Collection [Users] -> Documents [001], [002], [003]. Now I want to query in Users for the ids 001 and 003. Is there an easy way to do this in flutter, or is the recommended way to just just query for 001 and 003 individually ?
回答1:
You can use an in query for anywhere up to 10 documents.
collectionRef.where("country", whereIn: ["USA", "Japan"])
If you have more than 10, you can either load them in batches of 10, or so individual calls for each document.
来源:https://stackoverflow.com/questions/61292207/how-to-query-a-list-of-objects-with-firebase-in-flutter