Skip to content

Commit b4bb0e2

Browse files
Google APIscopybara-github
authored andcommitted
feat: add ApiScope and COLLECTION_RECURSIVE query_scope for Firestore index
PiperOrigin-RevId: 532955594
1 parent aeae5ea commit b4bb0e2

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

google/firestore/admin/v1/index.proto

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -50,6 +50,21 @@ message Index {
5050
// against all collections that has the collection id specified by the
5151
// index.
5252
COLLECTION_GROUP = 2;
53+
54+
// Include all the collections's ancestor in the index. Only available for
55+
// Datastore Mode databases.
56+
COLLECTION_RECURSIVE = 3;
57+
}
58+
59+
// API Scope defines the APIs (Firestore Native, or Firestore in
60+
// Datastore Mode) that are supported for queries.
61+
enum ApiScope {
62+
// The index can only be used by the Firestore Native query API.
63+
// This is the default.
64+
ANY_API = 0;
65+
66+
// The index can only be used by the Firestore in Datastore Mode query API.
67+
DATASTORE_MODE_API = 1;
5368
}
5469

5570
// A field in an index.
@@ -138,14 +153,17 @@ message Index {
138153
// time, and that have the same collection id as this index.
139154
QueryScope query_scope = 2;
140155

156+
// The API scope supported by this index.
157+
ApiScope api_scope = 5;
158+
141159
// The fields supported by this index.
142160
//
143-
// For composite indexes, this is always 2 or more fields.
144-
// The last field entry is always for the field path `__name__`. If, on
145-
// creation, `__name__` was not specified as the last field, it will be added
146-
// automatically with the same direction as that of the last field defined. If
147-
// the final field in a composite index is not directional, the `__name__`
148-
// will be ordered ASCENDING (unless explicitly specified).
161+
// For composite indexes, this requires a minimum of 2 and a maximum of 100
162+
// fields. The last field entry is always for the field path `__name__`. If,
163+
// on creation, `__name__` was not specified as the last field, it will be
164+
// added automatically with the same direction as that of the last field
165+
// defined. If the final field in a composite index is not directional, the
166+
// `__name__` will be ordered ASCENDING (unless explicitly specified).
149167
//
150168
// For single field indexes, this will always be exactly one entry with a
151169
// field path equal to the field path of the associated field.

0 commit comments

Comments
 (0)