Skip to content

Firestore: Using offset greater than 1000 on a query doesn't work #6924

@KiwiPolarBear

Description

@KiwiPolarBear

Environment details

macOS Mojave 10.14.1
Python 3.6
google-cloud-firestore==0.30.0

Steps to reproduce

  1. Create a query to get a large collection (over 1000 documents)
  2. Add an offset greater than 1000 to the query
  3. Get the query and iterate over the documents
  4. You should get an exception about having no documents

Code example

from google.cloud import firestore

client = firestore.Client()

documents = client.collection('Collection').order_by('field').offset(1001).get()

for document in documents:
    pass

Stack trace

ValueError: Unexpected server response. All responses other than the first must contain a document. The response at index 1 was
read_time {
  seconds: 1544736718
  nanos: 109409000
}
skipped_results: 1
.

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the Firestore API.backendtype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions