Skip to content

Commit

Permalink
feat: add ApiScope and COLLECTION_RECURSIVE query_scope for Firestore…
Browse files Browse the repository at this point in the history
… index

PiperOrigin-RevId: 532955594
  • Loading branch information
Google APIs authored and Copybara-Service committed May 18, 2023
1 parent aeae5ea commit b4bb0e2
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions google/firestore/admin/v1/index.proto
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,6 +50,21 @@ message Index {
// against all collections that has the collection id specified by the
// index.
COLLECTION_GROUP = 2;

// Include all the collections's ancestor in the index. Only available for
// Datastore Mode databases.
COLLECTION_RECURSIVE = 3;
}

// API Scope defines the APIs (Firestore Native, or Firestore in
// Datastore Mode) that are supported for queries.
enum ApiScope {
// The index can only be used by the Firestore Native query API.
// This is the default.
ANY_API = 0;

// The index can only be used by the Firestore in Datastore Mode query API.
DATASTORE_MODE_API = 1;
}

// A field in an index.
Expand Down Expand Up @@ -138,14 +153,17 @@ message Index {
// time, and that have the same collection id as this index.
QueryScope query_scope = 2;

// The API scope supported by this index.
ApiScope api_scope = 5;

// The fields supported by this index.
//
// For composite indexes, this is always 2 or more fields.
// The last field entry is always for the field path `__name__`. If, on
// creation, `__name__` was not specified as the last field, it will be added
// automatically with the same direction as that of the last field defined. If
// the final field in a composite index is not directional, the `__name__`
// will be ordered ASCENDING (unless explicitly specified).
// For composite indexes, this requires a minimum of 2 and a maximum of 100
// fields. The last field entry is always for the field path `__name__`. If,
// on creation, `__name__` was not specified as the last field, it will be
// added automatically with the same direction as that of the last field
// defined. If the final field in a composite index is not directional, the
// `__name__` will be ordered ASCENDING (unless explicitly specified).
//
// For single field indexes, this will always be exactly one entry with a
// field path equal to the field path of the associated field.
Expand Down

0 comments on commit b4bb0e2

Please sign in to comment.