Google Firestore - how to get document by multiple ids in one round trip?

前端 未结 11 1812
余生分开走
余生分开走 2020-11-21 22:49

I am wondering if it\'s possible to get multiple documents by list of ids in one round trip (network call) to the Firestore.

11条回答
  •  花落未央
    2020-11-21 23:26

    If you are using flutter, you can do the following:

    Firestore.instance.collection('your collection name').where(FieldPath.documentId, whereIn:[list containing multiple document IDs]).getDocuments();
    

    This will return a Future containing List which you can iterate as you feel fit.

提交回复
热议问题