firestore paging with multiple parallel promises i

2019-08-18 08:38发布

I am trying to implement the paging logic here: https://firebase.google.com/docs/firestore/query-data/query-cursors but for a Promise.all() case.

I am trying to implement an IN query, but as discussed here: Google Cloud Firestore - how to do an OR query for array items it is not supported.

Therefore, inside a forEach loop, I am creating some get() queries (for each "where" clause), pushing them inside some "promises" array then calling Promise.all(promises). When I do it this way, the result will be a collection of documents returned at once. Yes, IN query succeeded...

But the problem is, in this case, it is not possible to get the "lastVisible" document (as described in the first link) for each individual query. So how would you go about paging it? It seems like it is not possible to do paging for this kind of an IN query implementation. Any other ways to do this? I would appreciate your expert opinion firebasers. Cheers.

0条回答
登录 后发表回答