def next_page()

in bookshelf/firestore.py [0:0]


def next_page(limit=10, start_after=None):
    db = firestore.Client()

    query = db.collection(u'Book').limit(limit).order_by(u'title')

    if start_after:
        # Construct a new query starting at this document.
        query = query.start_after({u'title': start_after})

    docs = query.stream()
    docs = list(map(document_to_dict, docs))

    last_title = None
    if limit == len(docs):
        # Get the last document from the results and set as the last title.
        last_title = docs[-1][u'title']
    return docs, last_title