Skip to content

Firestore: impose required semantics for snapshots as cursors.#6837

Merged
tseaver merged 1 commit intogoogleapis:masterfrom
tseaver:6665-firestore-snapshot_cursor_semantics
Dec 12, 2018
Merged

Firestore: impose required semantics for snapshots as cursors.#6837
tseaver merged 1 commit intogoogleapis:masterfrom
tseaver:6665-firestore-snapshot_cursor_semantics

Conversation

@tseaver
Copy link
Contributor

@tseaver tseaver commented Dec 4, 2018

  • Snapshot cursors imply on ordering on __name__, if not already present. Implied ordering is added at the end of the list, matching the direction of the prior entry (ASCENDING if none exist).

  • Snapshots copy their document reference into the __name__ field of their document values.

  • Disallow use of snapshots from foreign collections as query cursors.

  • In a query with one or more where clauses using ordering operators, and including a snapshot cursor, we must add ordering on the field(s) used (IFF the field is not already in the query's order_by).

Closes #6665.

- Snapshot cursors imply on ordering on '__name__', if not already
  present.  Implied ordering is added at the end of the list, matching
  the direction of the prior entry ('ASCENDING' if none exist).

- Snapshots copy their document reference into the '__name__' field
  of their document values.

- Disallow use of snapshots from foreign collections as query cursors.

- In a query with one or more 'where' clauses using ordering operators,
  and including a snapshot cursor, we must add ordering on the field(s)
  used (IFF the field is not already in the query's 'order_by').

Closes #6665.
@tseaver tseaver added the api: firestore Issues related to the Firestore API. label Dec 4, 2018
@tseaver tseaver requested a review from crwilcox December 4, 2018 15:27
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 4, 2018
@tseaver tseaver requested a review from mcdonc December 5, 2018 20:45
@tseaver tseaver merged commit 922ac18 into googleapis:master Dec 12, 2018
@tseaver tseaver deleted the 6665-firestore-snapshot_cursor_semantics branch December 12, 2018 20:34
parthea pushed a commit that referenced this pull request Nov 24, 2025
- Snapshot cursors imply on ordering on '__name__', if not already
  present.  Implied ordering is added at the end of the list, matching
  the direction of the prior entry ('ASCENDING' if none exist).

- Snapshots copy their document reference into the '__name__' field
  of their document values.

- Disallow use of snapshots from foreign collections as query cursors.

- In a query with one or more 'where' clauses using ordering operators,
  and including a snapshot cursor, we must add ordering on the field(s)
  used (IFF the field is not already in the query's 'order_by').

Closes #6665.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the Firestore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants