@@ -66,6 +66,9 @@ message Index {
6666
6767 // The index can only be used by the Firestore in Datastore Mode query API.
6868 DATASTORE_MODE_API = 1 ;
69+
70+ // The index can only be used by the MONGODB_COMPATIBLE_API.
71+ MONGODB_COMPATIBLE_API = 2 ;
6972 }
7073
7174 // A field in an index.
@@ -162,6 +165,32 @@ message Index {
162165 NEEDS_REPAIR = 3 ;
163166 }
164167
168+ // The density configuration for the index.
169+ enum Density {
170+ // Unspecified. It will use database default setting. This value is input
171+ // only.
172+ DENSITY_UNSPECIFIED = 0 ;
173+
174+ // In order for an index entry to be added, the document must
175+ // contain all fields specified in the index.
176+ //
177+ // This is the only allowed value for indexes having ApiScope `ANY_API` and
178+ // `DATASTORE_MODE_API`.
179+ SPARSE_ALL = 1 ;
180+
181+ // In order for an index entry to be added, the document must
182+ // contain at least one of the fields specified in the index.
183+ // Non-existent fields are treated as having a NULL value when generating
184+ // index entries.
185+ SPARSE_ANY = 2 ;
186+
187+ // An index entry will be added regardless of whether the
188+ // document contains any of the fields specified in the index.
189+ // Non-existent fields are treated as having a NULL value when generating
190+ // index entries.
191+ DENSE = 3 ;
192+ }
193+
165194 // Output only. A server defined name for this index.
166195 // The form of this name for composite indexes will be:
167196 // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
@@ -195,4 +224,20 @@ message Index {
195224
196225 // Output only. The serving state of the index.
197226 State state = 4 ;
227+
228+ // Immutable. The density configuration of the index.
229+ Density density = 6 [(google.api.field_behavior ) = IMMUTABLE ];
230+
231+ // Optional. Whether the index is multikey. By default, the index is not
232+ // multikey. For non-multikey indexes, none of the paths in the index
233+ // definition reach or traverse an array, except via an explicit array index.
234+ // For multikey indexes, at most one of the paths in the index definition
235+ // reach or traverse an array, except via an explicit array index. Violations
236+ // will result in errors.
237+ //
238+ // Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
239+ bool multikey = 7 [(google.api.field_behavior ) = OPTIONAL ];
240+
241+ // Optional. The number of shards for the index.
242+ int32 shard_count = 8 [(google.api.field_behavior ) = OPTIONAL ];
198243}
0 commit comments