1
+ // Copyright 2018 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
+
1
15
syntax = "proto3" ;
2
16
3
17
package firestore.client ;
@@ -20,14 +34,35 @@ message NoDocument {
20
34
google.protobuf.Timestamp read_time = 2 ;
21
35
}
22
36
23
- // Represents either an existing document or the explicitly known absence of a
24
- // document.
37
+ // A message indicating that the document that is known to exist but its data
38
+ // is unknown.
39
+ message UnknownDocument {
40
+ // The name of the document that is known to exist, in the standard format:
41
+ // `projects/{project_id}/databases/{database_id}/documents/{document_path}`
42
+ string name = 1 ;
43
+
44
+ // The version at which we know the document exists.
45
+ google.protobuf.Timestamp version = 2 ;
46
+ }
47
+
48
+ // Represents either an existing document, the explicitly known absence of a
49
+ // document, or a document that is known to exist (at some version) but whose
50
+ // contents are unknown.
25
51
message MaybeDocument {
26
52
oneof document_type {
27
53
// Used if the document is known to not exist.
28
54
NoDocument no_document = 1 ;
29
55
30
56
// The document (if it exists).
31
57
google.firestore.v1beta1.Document document = 2 ;
58
+
59
+ // Used if the document is known to exist but its data is unknown.
60
+ UnknownDocument unknown_document = 3 ;
32
61
}
62
+
63
+ // `has_committed_mutations` marks documents that were written to the remote
64
+ // document store based on a write acknowledgment. These documents are
65
+ // potentially inconsistent with the backend's copy and use the write's
66
+ // commit version as their document version.
67
+ bool has_committed_mutations = 4 ;
33
68
}
0 commit comments