|
1 |
| -// Copyright 2022 Google LLC |
| 1 | +// Copyright 2023 Google LLC |
2 | 2 | //
|
3 | 3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
4 | 4 | // you may not use this file except in compliance with the License.
|
@@ -50,6 +50,21 @@ message Index {
|
50 | 50 | // against all collections that has the collection id specified by the
|
51 | 51 | // index.
|
52 | 52 | 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; |
53 | 68 | }
|
54 | 69 |
|
55 | 70 | // A field in an index.
|
@@ -138,14 +153,17 @@ message Index {
|
138 | 153 | // time, and that have the same collection id as this index.
|
139 | 154 | QueryScope query_scope = 2;
|
140 | 155 |
|
| 156 | + // The API scope supported by this index. |
| 157 | + ApiScope api_scope = 5; |
| 158 | + |
141 | 159 | // The fields supported by this index.
|
142 | 160 | //
|
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). |
149 | 167 | //
|
150 | 168 | // For single field indexes, this will always be exactly one entry with a
|
151 | 169 | // field path equal to the field path of the associated field.
|
|
0 commit comments