HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/help/man/man1/gcloud_beta_firestore_indexes_composite_create.1
.TH "GCLOUD_BETA_FIRESTORE_INDEXES_COMPOSITE_CREATE" 1



.SH "NAME"
.HP
gcloud beta firestore indexes composite create \- create a new composite index



.SH "SYNOPSIS"
.HP
\f5gcloud beta firestore indexes composite create\fR \fB\-\-field\-config\fR=[\fIarray\-config\fR=\fIARRAY\-CONFIG\fR],[\fIfield\-path\fR=\fIFIELD\-PATH\fR],[\fIorder\fR=\fIORDER\fR],[\fIvector\-config\fR=\fIVECTOR\-CONFIG\fR] (\fB\-\-collection\-group\fR=\fICOLLECTION_GROUP\fR\ :\ \fB\-\-database\fR=\fIDATABASE\fR) [\fB\-\-api\-scope\fR=\fIAPI_SCOPE\fR;\ default="any\-api"] [\fB\-\-async\fR] [\fB\-\-density\fR=\fIDENSITY\fR] [\fB\-\-multikey\fR] [\fB\-\-query\-scope\fR=\fIQUERY_SCOPE\fR;\ default="collection"] [\fB\-\-unique\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(BETA)\fR Create a new composite index.



.SH "EXAMPLES"

The following command creates a composite index with fields \f5user_id\fR (in
descending order) followed by \f5timestamp\fR (in descending order) in the
\f5Events\fR collection group.

.RS 2m
$ gcloud beta firestore indexes composite create \e
    \-\-collection\-group=Events \e
    \-\-field\-config=field\-path=user\-id,order=descending \e
    \-\-field\-config=field\-path=timestamp,order=descending
.RE

.RS 2m
$ gcloud beta firestore indexes composite create \e
    \-\-database=(default) \-\-collection\-group=Events \e
    \-\-field\-config=field\-path=user\-id,order=descending \e
    \-\-field\-config=field\-path=timestamp,order=descending
.RE



.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m
\fB\-\-field\-config\fR=[\fIarray\-config\fR=\fIARRAY\-CONFIG\fR],[\fIfield\-path\fR=\fIFIELD\-PATH\fR],[\fIorder\fR=\fIORDER\fR],[\fIvector\-config\fR=\fIVECTOR\-CONFIG\fR]

Required, Configuration for an index field.

.RS 2m
.TP 2m
\fBarray\-config\fR
Specifies the configuration for an array field. The only valid option is
\'contains'. Exactly one of 'order', 'array\-config', or 'vector\-config' must
be specified.

.TP 2m
\fBfield\-path\fR
Specifies the field path (e.g. 'address.city'). This is required.

.TP 2m
\fBorder\fR
Specifies the order. Valid options are 'ascending', 'descending'. Exactly one of
\'order', 'array\-config', or 'vector\-config' must be specified.

.TP 2m
\fBvector\-config\fR
Specifies the configuration for a vector field. Exactly one of 'order',
\'array\-config', or 'vector\-config' must be specified.

.RS 2m
.TP 2m
\fBdimension\fR
Sets \f5dimension\fR value.

.TP 2m
\fBflat\fR
Sets \f5flat\fR value.

.RE
.RE
.sp
\fBShorthand Example:\fR


.RS 2m
\-\-field\-config=array\-config=string,field\-path=string,order=string,vector\-config={dimension=int,flat} \-\-field\-config=array\-config=string,field\-path=string,order=string,vector\-config={dimension=int,flat}
.RE


\fBJSON Example:\fR


.RS 2m
\-\-field\-config='[{"array\-config": "string", "field\-path": "string", "order": "string", "vector\-config": {"dimension": int, "flat": {}}}]'
.RE


\fBFile Example:\fR


.RS 2m
\-\-field\-config=path_to_file.(yaml|json)
.RE


.TP 2m

Collection group resource \- Collection group of the index. The arguments in
this group can be used to specify the attributes of this resource. (NOTE) Some
attributes are not given arguments in this group but can be set in other ways.

To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-collection\-group\fR on the command line with a
fully specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp

This must be specified.


.RS 2m
.TP 2m
\fB\-\-collection\-group\fR=\fICOLLECTION_GROUP\fR

ID of the collection group or fully qualified identifier for the collection
group.

To set the \f5collection\-group\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-collection\-group\fR on the command line.
.RE
.sp

This flag argument must be specified if any of the other arguments in this group
are specified.

.TP 2m
\fB\-\-database\fR=\fIDATABASE\fR

Database of the collection group.


To set the \f5database\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-collection\-group\fR on the command line with a
fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-database\fR on the command line;
.IP "\(bu" 2m
the default value of argument [\-\-database] is \f5(default)\fR.
.RE
.sp


.RE
.RE
.sp

.SH "OPTIONAL FLAGS"

.RS 2m
.TP 2m
\fB\-\-api\-scope\fR=\fIAPI_SCOPE\fR; default="any\-api"

Api scope the index applies to. \fIAPI_SCOPE\fR must be one of: \fBany\-api\fR,
\fBdatastore\-mode\-api\fR, \fBmongodb\-compatible\-api\fR.

.TP 2m
\fB\-\-async\fR

Return immediately, without waiting for the operation in progress to complete.

.TP 2m
\fB\-\-density\fR=\fIDENSITY\fR

Density of the index. \fIDENSITY\fR must be one of: \fBdense\fR,
\fBdensity\-unspecified\fR, \fBsparse\-all\fR, \fBsparse\-any\fR.

.TP 2m
\fB\-\-multikey\fR

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.

.TP 2m
\fB\-\-query\-scope\fR=\fIQUERY_SCOPE\fR; default="collection"

Query scope the index applies to. \fIQUERY_SCOPE\fR must be one of:
\fBcollection\fR, \fBcollection\-group\fR, \fBcollection\-recursive\fR.

.TP 2m
\fB\-\-unique\fR

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


.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.



.SH "API REFERENCE"

This command uses the \fBfirestore/v1\fR API. The full documentation for this
API can be found at: https://cloud.google.com/firestore



.SH "NOTES"

This command is currently in beta and might change without notice. These
variants are also available:

.RS 2m
$ gcloud firestore indexes composite create
.RE

.RS 2m
$ gcloud alpha firestore indexes composite create
.RE