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

前端 未结 11 1811
余生分开走
余生分开走 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:37

    They have just announced this functionality, https://firebase.googleblog.com/2019/11/cloud-firestore-now-supports-in-queries.html .

    Now you can use queries like, but mind that the input size can't be greater than 10.

    userCollection.where('uid', 'in', ["1231","222","2131"])

提交回复
热议问题