v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1338139174.7 KB
projects

Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type IndexOperationMetadata.

post/v1/{+parent}/indexes

Path parameters

parentstring required

Required. A parent name of the form projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}

Request body

multikeyboolean

Optional. Whether the index is multikey. By default, the index is not multikey. For non-multikey indexes, none of the paths in the index definition reach or traverse an array, except via an explicit array index. For multikey indexes, at most one of the paths in the index definition reach or traverse an array, except via an explicit array index. Violations will result in errors. Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.

state'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'NEEDS_REPAIR'

Output only. The serving state of the index.

namestring

Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.

apiScope'ANY_API' | 'DATASTORE_MODE_API' | 'MONGODB_COMPATIBLE_API'

The API scope supported by this index.

uniqueboolean

Optional. Whether it is an unique index. Unique index ensures all values for the indexed field(s) are unique across documents.

shardCountinteger

Optional. The number of shards for the index.

queryScope'QUERY_SCOPE_UNSPECIFIED' | 'COLLECTION' | 'COLLECTION_GROUP' | 'COLLECTION_RECURSIVE'

Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection ID. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection ID as this index.

density'DENSITY_UNSPECIFIED' | 'SPARSE_ALL' | 'SPARSE_ANY' | 'DENSE'

Immutable. The density configuration of the index.

Response

Successful response