Pagination in firestore api

后端 未结 3 1791
故里飘歌
故里飘歌 2020-12-07 02:18

I am trying to paginate documents with firestore beta. I am following the official docs

I see there is a pageSize param to say how many documents you want to show, b

3条回答
  •  既然无缘
    2020-12-07 03:06

    Firestore range queries are based on an having anchor document. So you must know the (order-by properties of the) document that the range start with, and then use ref.startAfter(anchorDdoc).limit(10) (or ref.startAfter(valueOfAnchorDoc).limit(10)) to get the next page.

    The Firestore server-side Admin SDKs have an offset() call that allows the server to determine the document to starts at. But the client-side SDKs do not have this method.

提交回复
热议问题