Firestore pagination - how to find if there are more data after query (using limit)

前端 未结 2 819
花落未央
花落未央 2021-01-28 12:28

We use ndb datastore in our current python 2.7 standard environment. We migrating this application to python 3.7 standard environment with firestore (native mode).

We us

2条回答
  •  温柔的废话
    2021-01-28 12:58

    There is no direct equivalent in Firestore pagination. What you can do instead is fetch one more document than the N documents that the page requires, then use the presence of the N+1 document to determine if there is "more". You would omit the N+1 document from the displayed page, then start the next page at that N+1 document.

提交回复
热议问题