Skip to content

Commit e9164b2

Browse files
chore: update count up_to field type in aggregation queries (#628)
* chore: update count up_to field type in aggregation queries PiperOrigin-RevId: 469554568 Source-Link: googleapis/googleapis@c17c5a6 Source-Link: googleapis/googleapis-gen@0b6d950 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGI2ZDk1MDA0MGRhYzdiZDQzMTk0MWJlYTYwZGQ5Njk3NzAwMTFiYyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent dd2386b commit e9164b2

File tree

1 file changed

+14
-9
lines changed
  • packages/google-cloud-firestore/google/cloud/firestore_v1/types

1 file changed

+14
-9
lines changed

packages/google-cloud-firestore/google/cloud/firestore_v1/types/query.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,30 @@ class StructuredQuery(proto.Message):
4141
order_by (Sequence[google.cloud.firestore_v1.types.StructuredQuery.Order]):
4242
The order to apply to the query results.
4343
44+
Firestore allows callers to provide a full ordering, a
45+
partial ordering, or no ordering at all. In all cases,
4446
Firestore guarantees a stable ordering through the following
4547
rules:
4648
47-
- Any field required to appear in ``order_by``, that is not
48-
already specified in ``order_by``, is appended to the
49-
order in field name order by default.
49+
- The ``order_by`` is required to reference all fields used
50+
with an inequality filter.
51+
- All fields that are required to be in the ``order_by``
52+
but are not already present are appended in
53+
lexicographical ordering of the field name.
5054
- If an order on ``__name__`` is not specified, it is
5155
appended by default.
5256
5357
Fields are appended with the same sort direction as the last
5458
order specified, or 'ASCENDING' if no order was specified.
5559
For example:
5660
57-
- ``SELECT * FROM Foo ORDER BY A`` becomes
58-
``SELECT * FROM Foo ORDER BY A, __name__``
59-
- ``SELECT * FROM Foo ORDER BY A DESC`` becomes
60-
``SELECT * FROM Foo ORDER BY A DESC, __name__ DESC``
61-
- ``SELECT * FROM Foo WHERE A > 1`` becomes
62-
``SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__``
61+
- ``ORDER BY a`` becomes ``ORDER BY a ASC, __name__ ASC``
62+
- ``ORDER BY a DESC`` becomes
63+
``ORDER BY a DESC, __name__ DESC``
64+
- ``WHERE a > 1`` becomes
65+
``WHERE a > 1 ORDER BY a ASC, __name__ ASC``
66+
- ``WHERE __name__ > ... AND a > 1`` becomes
67+
``WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC``
6368
start_at (google.cloud.firestore_v1.types.Cursor):
6469
A starting point for the query results.
6570
end_at (google.cloud.firestore_v1.types.Cursor):

0 commit comments

Comments
 (0)