Update index definition reference in README.md#10542
Conversation
Reconcile this page with [documentation](https://firebase.google.com/docs/reference/firestore/indexes). Update for Native mode support in Enterprise edition.
There was a problem hiding this comment.
Code Review
This pull request updates the Firestore README to distinguish between Standard and Enterprise edition index schemas, adding documentation for new fields such as apiScope, density, and vectorConfig. The review feedback identifies several consistency and accuracy issues in the documentation, specifically regarding the indentation of code blocks, missing optionality markers for several fields, and minor typographical or grammatical errors in the descriptions.
| collectionGroup: string // Labeled "Collection ID" in the Firebase console | ||
| queryScope: string // One of "COLLECTION", "COLLECTION_GROUP" | ||
| apiScope: string // "ANY_API" (the default) is the only acceptable value. Optional. | ||
| density: string // "SPARSE_ALL" is the only acceptable value. Optional. | ||
| fields: array | ||
| fieldPath: string | ||
| order?: string // One of "ASCENDING", "DESCENDING"; excludes arrayConfig and vectorConfig properties | ||
| arrayConfig?: string // If this parameter used, must be "CONTAINS"; excludes order and vectorConfig properties | ||
| vectorConfig?: object // Indicates that this is a vector index; excludes order and arrayConfig properties | ||
| dimension: number // The resulting index will only include vectors of this dimension | ||
| flat: {} // Indicates the vector index is a flat index |
There was a problem hiding this comment.
The schema definition for the Standard edition has a few consistency and accuracy issues:
- Indentation: The block uses 0-space indentation for top-level properties, which is inconsistent with the rest of the file (e.g., the
FieldOverridessection and the previous version of this block use 2 spaces). - Optionality: The fields
apiScope,density, andflatare optional according to the API specification and the comments, but they are missing the?suffix used for other optional fields likeorderandarrayConfig. - Grammar: In the
arrayConfigcomment, 'If this parameter used' should be 'If this parameter is used'.
| collectionGroup: string // Labeled "Collection ID" in the Firebase console | |
| queryScope: string // One of "COLLECTION", "COLLECTION_GROUP" | |
| apiScope: string // "ANY_API" (the default) is the only acceptable value. Optional. | |
| density: string // "SPARSE_ALL" is the only acceptable value. Optional. | |
| fields: array | |
| fieldPath: string | |
| order?: string // One of "ASCENDING", "DESCENDING"; excludes arrayConfig and vectorConfig properties | |
| arrayConfig?: string // If this parameter used, must be "CONTAINS"; excludes order and vectorConfig properties | |
| vectorConfig?: object // Indicates that this is a vector index; excludes order and arrayConfig properties | |
| dimension: number // The resulting index will only include vectors of this dimension | |
| flat: {} // Indicates the vector index is a flat index | |
| collectionGroup: string // Labeled "Collection ID" in the Firebase console | |
| queryScope: string // One of "COLLECTION", "COLLECTION_GROUP" | |
| apiScope?: string // "ANY_API" (the default) is the only acceptable value. Optional. | |
| density?: string // "SPARSE_ALL" is the only acceptable value. Optional. | |
| fields: array | |
| fieldPath: string | |
| order?: string // One of "ASCENDING", "DESCENDING"; excludes arrayConfig and vectorConfig properties | |
| arrayConfig?: string // If this parameter is used, must be "CONTAINS"; excludes order and vectorConfig properties | |
| vectorConfig?: object // Indicates that this is a vector index; excludes order and arrayConfig properties | |
| dimension: number // The resulting index will only include vectors of this dimension | |
| flat?: {} // Indicates the vector index is a flat index |
References
- Maintain consistency in documentation formatting and technical accuracy regarding schema optionality.
| collectionGroup: string // Labeled "Collection ID" in the Firebase console | ||
| queryScope: string // One of "COLLECTION", "COLLECTION_GROUP" | ||
| apiScope: string // For Native mode, omit or set to "ANY_API". For MongoDB compatiblity, use "MONGODB_COMPATIBLE_API" | ||
| multikey: boolean // Indicates if this is a multikey index | ||
| density: string // One of "SPARSE_ANY" or "DENSE" | ||
| fields: array | ||
| fieldPath: string | ||
| order?: string // One of "ASCENDING", "DESCENDING"; excludes arrayConfig and vectorConfig properties | ||
| arrayConfig?: string // If this parameter used, must be "CONTAINS"; excludes order and vectorConfig properties | ||
| vectorConfig?: object // Indicates that this is a vector index; excludes order and arrayConfig properties | ||
| dimension: number // The resulting index will only include vectors of this dimension | ||
| flat: {} // Indicates the vector index is a flat index |
There was a problem hiding this comment.
The schema definition for the Enterprise edition has several issues:
- Indentation: The block uses 0-space indentation for top-level properties, which is inconsistent with the 2-space indentation used elsewhere in the file.
- Optionality: The fields
apiScope,multikey,density, andflatare optional but missing the?suffix. - Typo: In the
apiScopecomment, 'compatiblity' is misspelled. - Grammar: In the
arrayConfigcomment, 'If this parameter used' should be 'If this parameter is used'.
| collectionGroup: string // Labeled "Collection ID" in the Firebase console | |
| queryScope: string // One of "COLLECTION", "COLLECTION_GROUP" | |
| apiScope: string // For Native mode, omit or set to "ANY_API". For MongoDB compatiblity, use "MONGODB_COMPATIBLE_API" | |
| multikey: boolean // Indicates if this is a multikey index | |
| density: string // One of "SPARSE_ANY" or "DENSE" | |
| fields: array | |
| fieldPath: string | |
| order?: string // One of "ASCENDING", "DESCENDING"; excludes arrayConfig and vectorConfig properties | |
| arrayConfig?: string // If this parameter used, must be "CONTAINS"; excludes order and vectorConfig properties | |
| vectorConfig?: object // Indicates that this is a vector index; excludes order and arrayConfig properties | |
| dimension: number // The resulting index will only include vectors of this dimension | |
| flat: {} // Indicates the vector index is a flat index | |
| collectionGroup: string // Labeled "Collection ID" in the Firebase console | |
| queryScope: string // One of "COLLECTION", "COLLECTION_GROUP" | |
| apiScope?: string // For Native mode, omit or set to "ANY_API". For MongoDB compatibility, use "MONGODB_COMPATIBLE_API" | |
| multikey?: boolean // Indicates if this is a multikey index | |
| density?: string // One of "SPARSE_ANY" or "DENSE" | |
| fields: array | |
| fieldPath: string | |
| order?: string // One of "ASCENDING", "DESCENDING"; excludes arrayConfig and vectorConfig properties | |
| arrayConfig?: string // If this parameter is used, must be "CONTAINS"; excludes order and vectorConfig properties | |
| vectorConfig?: object // Indicates that this is a vector index; excludes order and arrayConfig properties | |
| dimension: number // The resulting index will only include vectors of this dimension | |
| flat?: {} // Indicates the vector index is a flat index |
References
- Maintain consistency in documentation formatting and technical accuracy regarding schema optionality.
There was a problem hiding this comment.
Thank you for contributing!
Can we address the comments from Gemini? These look like reasonable suggestions to me.
One additional mismatch: the field-mode note still only calls out order and arrayConfig, but validateIndex() also accepts vectorConfig and searchConfig. Could that be updated too?
Reconcile this page with documentation. Update index definition for Native mode support in Enterprise edition.