1 // Copyright 2018 Google LLC.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 package google.firestore.v1;
20 import "google/api/annotations.proto";
21 import "google/protobuf/struct.proto";
22 import "google/protobuf/timestamp.proto";
23 import "google/type/latlng.proto";
25 option csharp_namespace = "Google.Cloud.Firestore.V1";
26 option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
27 option java_multiple_files = true;
28 option java_outer_classname = "DocumentProto";
29 option java_package = "com.google.firestore.v1";
30 option objc_class_prefix = "GCFS";
31 option php_namespace = "Google\\Cloud\\Firestore\\V1";
33 // A Firestore document.
35 // Must not exceed 1 MiB - 4 bytes.
37 // The resource name of the document, for example
38 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
41 // The document's fields.
43 // The map keys represent field names.
45 // A simple field name contains only characters `a` to `z`, `A` to `Z`,
46 // `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
49 // Field names matching the regular expression `__.*__` are reserved. Reserved
50 // field names are forbidden except in certain documented contexts. The map
51 // keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
54 // Field paths may be used in other contexts to refer to structured fields
55 // defined here. For `map_value`, the field path is represented by the simple
56 // or quoted field names of the containing fields, delimited by `.`. For
57 // example, the structured field
58 // `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
59 // represented by the field path `foo.x&y`.
61 // Within a field path, a quoted field name starts and ends with `` ` `` and
62 // may contain any character. Some characters, including `` ` ``, must be
63 // escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
64 // `` `bak\`tik` `` represents `` bak`tik ``.
65 map<string, Value> fields = 2;
67 // Output only. The time at which the document was created.
69 // This value increases monotonically when a document is deleted then
70 // recreated. It can also be compared to values from other documents and
71 // the `read_time` of a query.
72 google.protobuf.Timestamp create_time = 3;
74 // Output only. The time at which the document was last changed.
76 // This value is initially set to the `create_time` then increases
77 // monotonically with each change to the document. It can also be
78 // compared to values from other documents and the `read_time` of a query.
79 google.protobuf.Timestamp update_time = 4;
82 // A message that can hold any of the supported value types.
84 // Must have a value set.
87 google.protobuf.NullValue null_value = 11;
90 bool boolean_value = 1;
93 int64 integer_value = 2;
96 double double_value = 3;
100 // Precise only to microseconds. When stored, any additional precision is
102 google.protobuf.Timestamp timestamp_value = 10;
106 // The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
107 // Only the first 1,500 bytes of the UTF-8 representation are considered by
109 string string_value = 17;
113 // Must not exceed 1 MiB - 89 bytes.
114 // Only the first 1,500 bytes are considered by queries.
115 bytes bytes_value = 18;
117 // A reference to a document. For example:
118 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
119 string reference_value = 5;
121 // A geo point value representing a point on the surface of Earth.
122 google.type.LatLng geo_point_value = 8;
126 // Cannot directly contain another array value, though can contain an
127 // map which contains another array.
128 ArrayValue array_value = 9;
131 MapValue map_value = 6;
137 // Values in the array.
138 repeated Value values = 1;
145 // The map keys represent field names. Field names matching the regular
146 // expression `__.*__` are reserved. Reserved field names are forbidden except
147 // in certain documented contexts. The map keys, represented as UTF-8, must
148 // not exceed 1,500 bytes and cannot be empty.
149 map<string, Value> fields = 1;