index.proto 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Copyright 2019 Google LLC.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. syntax = "proto3";
  16. package google.firestore.admin.v1beta1;
  17. import "google/api/annotations.proto";
  18. option csharp_namespace = "Google.Cloud.Firestore.Admin.V1Beta1";
  19. option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1beta1;admin";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "IndexProto";
  22. option java_package = "com.google.firestore.admin.v1beta1";
  23. option objc_class_prefix = "GCFS";
  24. // A field of an index.
  25. message IndexField {
  26. // The mode determines how a field is indexed.
  27. enum Mode {
  28. // The mode is unspecified.
  29. MODE_UNSPECIFIED = 0;
  30. // The field's values are indexed so as to support sequencing in
  31. // ascending order and also query by <, >, <=, >=, and =.
  32. ASCENDING = 2;
  33. // The field's values are indexed so as to support sequencing in
  34. // descending order and also query by <, >, <=, >=, and =.
  35. DESCENDING = 3;
  36. // The field's array values are indexed so as to support membership using
  37. // ARRAY_CONTAINS queries.
  38. ARRAY_CONTAINS = 4;
  39. }
  40. // The path of the field. Must match the field path specification described
  41. // by [google.firestore.v1beta1.Document.fields][fields].
  42. // Special field path `__name__` may be used by itself or at the end of a
  43. // path. `__type__` may be used only at the end of path.
  44. string field_path = 1;
  45. // The field's mode.
  46. Mode mode = 2;
  47. }
  48. // An index definition.
  49. message Index {
  50. // The state of an index. During index creation, an index will be in the
  51. // `CREATING` state. If the index is created successfully, it will transition
  52. // to the `READY` state. If the index is not able to be created, it will
  53. // transition to the `ERROR` state.
  54. enum State {
  55. // The state is unspecified.
  56. STATE_UNSPECIFIED = 0;
  57. // The index is being created.
  58. // There is an active long-running operation for the index.
  59. // The index is updated when writing a document.
  60. // Some index data may exist.
  61. CREATING = 3;
  62. // The index is ready to be used.
  63. // The index is updated when writing a document.
  64. // The index is fully populated from all stored documents it applies to.
  65. READY = 2;
  66. // The index was being created, but something went wrong.
  67. // There is no active long-running operation for the index,
  68. // and the most recently finished long-running operation failed.
  69. // The index is not updated when writing a document.
  70. // Some index data may exist.
  71. ERROR = 5;
  72. }
  73. // The resource name of the index.
  74. // Output only.
  75. string name = 1;
  76. // The collection ID to which this index applies. Required.
  77. string collection_id = 2;
  78. // The fields to index.
  79. repeated IndexField fields = 3;
  80. // The state of the index.
  81. // Output only.
  82. State state = 6;
  83. }