@google-cloud/firestore-api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -0
- package/build/protos/google/firestore/admin/v1/backup.proto +112 -0
- package/build/protos/google/firestore/admin/v1/database.proto +403 -0
- package/build/protos/google/firestore/admin/v1/field.proto +154 -0
- package/build/protos/google/firestore/admin/v1/firestore_admin.proto +1229 -0
- package/build/protos/google/firestore/admin/v1/index.proto +378 -0
- package/build/protos/google/firestore/admin/v1/location.proto +30 -0
- package/build/protos/google/firestore/admin/v1/operation.proto +330 -0
- package/build/protos/google/firestore/admin/v1/realtime_updates.proto +40 -0
- package/build/protos/google/firestore/admin/v1/schedule.proto +95 -0
- package/build/protos/google/firestore/admin/v1/snapshot.proto +53 -0
- package/build/protos/google/firestore/admin/v1/user_creds.proto +86 -0
- package/build/protos/google/firestore/v1/aggregation_result.proto +43 -0
- package/build/protos/google/firestore/v1/bloom_filter.proto +73 -0
- package/build/protos/google/firestore/v1/common.proto +111 -0
- package/build/protos/google/firestore/v1/document.proto +247 -0
- package/build/protos/google/firestore/v1/explain_stats.proto +41 -0
- package/build/protos/google/firestore/v1/firestore.proto +1237 -0
- package/build/protos/google/firestore/v1/pipeline.proto +43 -0
- package/build/protos/google/firestore/v1/query.proto +600 -0
- package/build/protos/google/firestore/v1/query_profile.proto +92 -0
- package/build/protos/google/firestore/v1/write.proto +286 -0
- package/build/protos/google/firestore/v1beta1/common.proto +82 -0
- package/build/protos/google/firestore/v1beta1/document.proto +149 -0
- package/build/protos/google/firestore/v1beta1/firestore.proto +900 -0
- package/build/protos/google/firestore/v1beta1/query.proto +300 -0
- package/build/protos/google/firestore/v1beta1/undeliverable_first_gen_event.proto +75 -0
- package/build/protos/google/firestore/v1beta1/write.proto +258 -0
- package/build/protos/protos.d.ts +35648 -0
- package/build/protos/protos.js +1 -0
- package/build/protos/protos.json +1 -0
- package/build/src/index.d.ts +13 -0
- package/build/src/index.js +30 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v1/firestore_admin_client.d.ts +1925 -0
- package/build/src/v1/firestore_admin_client.js +2734 -0
- package/build/src/v1/firestore_admin_client.js.map +1 -0
- package/build/src/v1/firestore_admin_client_config.json +172 -0
- package/build/src/v1/firestore_admin_proto_list.json +13 -0
- package/build/src/v1/firestore_client.d.ts +1204 -0
- package/build/src/v1/firestore_client.js +1605 -0
- package/build/src/v1/firestore_client.js.map +1 -0
- package/build/src/v1/firestore_client_config.json +135 -0
- package/build/src/v1/firestore_proto_list.json +12 -0
- package/build/src/v1/gapic_metadata.json +351 -0
- package/build/src/v1/index.d.ts +2 -0
- package/build/src/v1/index.js +25 -0
- package/build/src/v1/index.js.map +1 -0
- package/build/src/v1beta1/firestore_client.d.ts +930 -0
- package/build/src/v1beta1/firestore_client.js +1310 -0
- package/build/src/v1beta1/firestore_client.js.map +1 -0
- package/build/src/v1beta1/firestore_client_config.json +99 -0
- package/build/src/v1beta1/firestore_proto_list.json +8 -0
- package/build/src/v1beta1/gapic_metadata.json +165 -0
- package/build/src/v1beta1/index.d.ts +1 -0
- package/build/src/v1beta1/index.js +23 -0
- package/build/src/v1beta1/index.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,1204 @@
|
|
|
1
|
+
import type * as gax from 'google-gax';
|
|
2
|
+
import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, LocationsClient, LocationProtos } from 'google-gax';
|
|
3
|
+
import { Transform } from 'stream';
|
|
4
|
+
import * as protos from '../../protos/protos';
|
|
5
|
+
/**
|
|
6
|
+
* The Cloud Firestore service.
|
|
7
|
+
*
|
|
8
|
+
* Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL
|
|
9
|
+
* document database that simplifies storing, syncing, and querying data for
|
|
10
|
+
* your mobile, web, and IoT apps at global scale. Its client libraries provide
|
|
11
|
+
* live synchronization and offline support, while its security features and
|
|
12
|
+
* integrations with Firebase and Google Cloud Platform accelerate building
|
|
13
|
+
* truly serverless apps.
|
|
14
|
+
* @class
|
|
15
|
+
* @memberof v1
|
|
16
|
+
*/
|
|
17
|
+
export declare class FirestoreClient {
|
|
18
|
+
private _terminated;
|
|
19
|
+
private _opts;
|
|
20
|
+
private _providedCustomServicePath;
|
|
21
|
+
private _gaxModule;
|
|
22
|
+
private _gaxGrpc;
|
|
23
|
+
private _protos;
|
|
24
|
+
private _defaults;
|
|
25
|
+
private _universeDomain;
|
|
26
|
+
private _servicePath;
|
|
27
|
+
private _log;
|
|
28
|
+
auth: gax.GoogleAuth;
|
|
29
|
+
descriptors: Descriptors;
|
|
30
|
+
warn: (code: string, message: string, warnType?: string) => void;
|
|
31
|
+
innerApiCalls: {
|
|
32
|
+
[name: string]: Function;
|
|
33
|
+
};
|
|
34
|
+
locationsClient: LocationsClient;
|
|
35
|
+
firestoreStub?: Promise<{
|
|
36
|
+
[name: string]: Function;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Construct an instance of FirestoreClient.
|
|
40
|
+
*
|
|
41
|
+
* @param {object} [options] - The configuration object.
|
|
42
|
+
* The options accepted by the constructor are described in detail
|
|
43
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
44
|
+
* The common options are:
|
|
45
|
+
* @param {object} [options.credentials] - Credentials object.
|
|
46
|
+
* @param {string} [options.credentials.client_email]
|
|
47
|
+
* @param {string} [options.credentials.private_key]
|
|
48
|
+
* @param {string} [options.email] - Account email address. Required when
|
|
49
|
+
* using a .pem or .p12 keyFilename.
|
|
50
|
+
* @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
|
|
51
|
+
* .p12 key downloaded from the Google Developers Console. If you provide
|
|
52
|
+
* a path to a JSON file, the projectId option below is not necessary.
|
|
53
|
+
* NOTE: .pem and .p12 require you to specify options.email as well.
|
|
54
|
+
* @param {number} [options.port] - The port on which to connect to
|
|
55
|
+
* the remote host.
|
|
56
|
+
* @param {string} [options.projectId] - The project ID from the Google
|
|
57
|
+
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
58
|
+
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
59
|
+
* app is running in an environment which supports
|
|
60
|
+
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
|
|
61
|
+
* your project ID will be detected automatically.
|
|
62
|
+
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
63
|
+
* API remote host.
|
|
64
|
+
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
65
|
+
* Follows the structure of {@link gapicConfig}.
|
|
66
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
|
67
|
+
* For more information, please check the
|
|
68
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
69
|
+
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
70
|
+
* need to avoid loading the default gRPC version and want to use the fallback
|
|
71
|
+
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
72
|
+
* ```
|
|
73
|
+
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
74
|
+
* const client = new FirestoreClient({fallback: true}, gax);
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
|
78
|
+
/**
|
|
79
|
+
* Initialize the client.
|
|
80
|
+
* Performs asynchronous operations (such as authentication) and prepares the client.
|
|
81
|
+
* This function will be called automatically when any class method is called for the
|
|
82
|
+
* first time, but if you need to initialize it before calling an actual method,
|
|
83
|
+
* feel free to call initialize() directly.
|
|
84
|
+
*
|
|
85
|
+
* You can await on this method if you want to make sure the client is initialized.
|
|
86
|
+
*
|
|
87
|
+
* @returns {Promise} A promise that resolves to an authenticated service stub.
|
|
88
|
+
*/
|
|
89
|
+
initialize(): Promise<{
|
|
90
|
+
[name: string]: Function;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* The DNS address for this API service.
|
|
94
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
95
|
+
* @returns {string} The DNS address for this service.
|
|
96
|
+
*/
|
|
97
|
+
static get servicePath(): string;
|
|
98
|
+
/**
|
|
99
|
+
* The DNS address for this API service - same as servicePath.
|
|
100
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
101
|
+
* @returns {string} The DNS address for this service.
|
|
102
|
+
*/
|
|
103
|
+
static get apiEndpoint(): string;
|
|
104
|
+
/**
|
|
105
|
+
* The DNS address for this API service.
|
|
106
|
+
* @returns {string} The DNS address for this service.
|
|
107
|
+
*/
|
|
108
|
+
get apiEndpoint(): string;
|
|
109
|
+
get universeDomain(): string;
|
|
110
|
+
/**
|
|
111
|
+
* The port for this API service.
|
|
112
|
+
* @returns {number} The default port for this service.
|
|
113
|
+
*/
|
|
114
|
+
static get port(): number;
|
|
115
|
+
/**
|
|
116
|
+
* The scopes needed to make gRPC calls for every method defined
|
|
117
|
+
* in this service.
|
|
118
|
+
* @returns {string[]} List of default scopes.
|
|
119
|
+
*/
|
|
120
|
+
static get scopes(): string[];
|
|
121
|
+
getProjectId(): Promise<string>;
|
|
122
|
+
getProjectId(callback: Callback<string, undefined, undefined>): void;
|
|
123
|
+
/**
|
|
124
|
+
* Gets a single document.
|
|
125
|
+
*
|
|
126
|
+
* @param {Object} request
|
|
127
|
+
* The request object that will be sent.
|
|
128
|
+
* @param {string} request.name
|
|
129
|
+
* Required. The resource name of the Document to get. In the format:
|
|
130
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
131
|
+
* @param {google.firestore.v1.DocumentMask} request.mask
|
|
132
|
+
* The fields to return. If not set, returns all fields.
|
|
133
|
+
*
|
|
134
|
+
* If the document has a field that is not present in this mask, that field
|
|
135
|
+
* will not be returned in the response.
|
|
136
|
+
* @param {Buffer} request.transaction
|
|
137
|
+
* Reads the document in a transaction.
|
|
138
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
139
|
+
* Reads the version of the document at the given time.
|
|
140
|
+
*
|
|
141
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
142
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
143
|
+
* minute timestamp within the past 7 days.
|
|
144
|
+
* @param {object} [options]
|
|
145
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
146
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
147
|
+
* The first element of the array is an object representing {@link protos.google.firestore.v1.Document|Document}.
|
|
148
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
149
|
+
* for more details and examples.
|
|
150
|
+
* @example <caption>include:samples/generated/v1/firestore.get_document.js</caption>
|
|
151
|
+
* region_tag:firestore_v1_generated_Firestore_GetDocument_async
|
|
152
|
+
*/
|
|
153
|
+
getDocument(request?: protos.google.firestore.v1.IGetDocumentRequest, options?: CallOptions): Promise<[
|
|
154
|
+
protos.google.firestore.v1.IDocument,
|
|
155
|
+
protos.google.firestore.v1.IGetDocumentRequest | undefined,
|
|
156
|
+
{} | undefined
|
|
157
|
+
]>;
|
|
158
|
+
getDocument(request: protos.google.firestore.v1.IGetDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
159
|
+
getDocument(request: protos.google.firestore.v1.IGetDocumentRequest, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
160
|
+
/**
|
|
161
|
+
* Updates or inserts a document.
|
|
162
|
+
*
|
|
163
|
+
* @param {Object} request
|
|
164
|
+
* The request object that will be sent.
|
|
165
|
+
* @param {google.firestore.v1.Document} request.document
|
|
166
|
+
* Required. The updated document.
|
|
167
|
+
* Creates the document if it does not already exist.
|
|
168
|
+
* @param {google.firestore.v1.DocumentMask} request.updateMask
|
|
169
|
+
* The fields to update.
|
|
170
|
+
* None of the field paths in the mask may contain a reserved name.
|
|
171
|
+
*
|
|
172
|
+
* If the document exists on the server and has fields not referenced in the
|
|
173
|
+
* mask, they are left unchanged.
|
|
174
|
+
* Fields referenced in the mask, but not present in the input document, are
|
|
175
|
+
* deleted from the document on the server.
|
|
176
|
+
* @param {google.firestore.v1.DocumentMask} request.mask
|
|
177
|
+
* The fields to return. If not set, returns all fields.
|
|
178
|
+
*
|
|
179
|
+
* If the document has a field that is not present in this mask, that field
|
|
180
|
+
* will not be returned in the response.
|
|
181
|
+
* @param {google.firestore.v1.Precondition} request.currentDocument
|
|
182
|
+
* An optional precondition on the document.
|
|
183
|
+
* The request will fail if this is set and not met by the target document.
|
|
184
|
+
* @param {object} [options]
|
|
185
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
186
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
187
|
+
* The first element of the array is an object representing {@link protos.google.firestore.v1.Document|Document}.
|
|
188
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
189
|
+
* for more details and examples.
|
|
190
|
+
* @example <caption>include:samples/generated/v1/firestore.update_document.js</caption>
|
|
191
|
+
* region_tag:firestore_v1_generated_Firestore_UpdateDocument_async
|
|
192
|
+
*/
|
|
193
|
+
updateDocument(request?: protos.google.firestore.v1.IUpdateDocumentRequest, options?: CallOptions): Promise<[
|
|
194
|
+
protos.google.firestore.v1.IDocument,
|
|
195
|
+
protos.google.firestore.v1.IUpdateDocumentRequest | undefined,
|
|
196
|
+
{} | undefined
|
|
197
|
+
]>;
|
|
198
|
+
updateDocument(request: protos.google.firestore.v1.IUpdateDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
199
|
+
updateDocument(request: protos.google.firestore.v1.IUpdateDocumentRequest, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
200
|
+
/**
|
|
201
|
+
* Deletes a document.
|
|
202
|
+
*
|
|
203
|
+
* @param {Object} request
|
|
204
|
+
* The request object that will be sent.
|
|
205
|
+
* @param {string} request.name
|
|
206
|
+
* Required. The resource name of the Document to delete. In the format:
|
|
207
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
208
|
+
* @param {google.firestore.v1.Precondition} request.currentDocument
|
|
209
|
+
* An optional precondition on the document.
|
|
210
|
+
* The request will fail if this is set and not met by the target document.
|
|
211
|
+
* @param {object} [options]
|
|
212
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
213
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
214
|
+
* The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
|
|
215
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
216
|
+
* for more details and examples.
|
|
217
|
+
* @example <caption>include:samples/generated/v1/firestore.delete_document.js</caption>
|
|
218
|
+
* region_tag:firestore_v1_generated_Firestore_DeleteDocument_async
|
|
219
|
+
*/
|
|
220
|
+
deleteDocument(request?: protos.google.firestore.v1.IDeleteDocumentRequest, options?: CallOptions): Promise<[
|
|
221
|
+
protos.google.protobuf.IEmpty,
|
|
222
|
+
protos.google.firestore.v1.IDeleteDocumentRequest | undefined,
|
|
223
|
+
{} | undefined
|
|
224
|
+
]>;
|
|
225
|
+
deleteDocument(request: protos.google.firestore.v1.IDeleteDocumentRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
226
|
+
deleteDocument(request: protos.google.firestore.v1.IDeleteDocumentRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
227
|
+
/**
|
|
228
|
+
* Starts a new transaction.
|
|
229
|
+
*
|
|
230
|
+
* @param {Object} request
|
|
231
|
+
* The request object that will be sent.
|
|
232
|
+
* @param {string} request.database
|
|
233
|
+
* Required. The database name. In the format:
|
|
234
|
+
* `projects/{project_id}/databases/{database_id}`.
|
|
235
|
+
* @param {google.firestore.v1.TransactionOptions} request.options
|
|
236
|
+
* The options for the transaction.
|
|
237
|
+
* Defaults to a read-write transaction.
|
|
238
|
+
* @param {object} [options]
|
|
239
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
240
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
241
|
+
* The first element of the array is an object representing {@link protos.google.firestore.v1.BeginTransactionResponse|BeginTransactionResponse}.
|
|
242
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
243
|
+
* for more details and examples.
|
|
244
|
+
* @example <caption>include:samples/generated/v1/firestore.begin_transaction.js</caption>
|
|
245
|
+
* region_tag:firestore_v1_generated_Firestore_BeginTransaction_async
|
|
246
|
+
*/
|
|
247
|
+
beginTransaction(request?: protos.google.firestore.v1.IBeginTransactionRequest, options?: CallOptions): Promise<[
|
|
248
|
+
protos.google.firestore.v1.IBeginTransactionResponse,
|
|
249
|
+
protos.google.firestore.v1.IBeginTransactionRequest | undefined,
|
|
250
|
+
{} | undefined
|
|
251
|
+
]>;
|
|
252
|
+
beginTransaction(request: protos.google.firestore.v1.IBeginTransactionRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IBeginTransactionResponse, protos.google.firestore.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void;
|
|
253
|
+
beginTransaction(request: protos.google.firestore.v1.IBeginTransactionRequest, callback: Callback<protos.google.firestore.v1.IBeginTransactionResponse, protos.google.firestore.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void;
|
|
254
|
+
/**
|
|
255
|
+
* Commits a transaction, while optionally updating documents.
|
|
256
|
+
*
|
|
257
|
+
* @param {Object} request
|
|
258
|
+
* The request object that will be sent.
|
|
259
|
+
* @param {string} request.database
|
|
260
|
+
* Required. The database name. In the format:
|
|
261
|
+
* `projects/{project_id}/databases/{database_id}`.
|
|
262
|
+
* @param {number[]} request.writes
|
|
263
|
+
* The writes to apply.
|
|
264
|
+
*
|
|
265
|
+
* Always executed atomically and in order.
|
|
266
|
+
* @param {Buffer} request.transaction
|
|
267
|
+
* If set, applies all writes in this transaction, and commits it.
|
|
268
|
+
* @param {object} [options]
|
|
269
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
270
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
271
|
+
* The first element of the array is an object representing {@link protos.google.firestore.v1.CommitResponse|CommitResponse}.
|
|
272
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
273
|
+
* for more details and examples.
|
|
274
|
+
* @example <caption>include:samples/generated/v1/firestore.commit.js</caption>
|
|
275
|
+
* region_tag:firestore_v1_generated_Firestore_Commit_async
|
|
276
|
+
*/
|
|
277
|
+
commit(request?: protos.google.firestore.v1.ICommitRequest, options?: CallOptions): Promise<[
|
|
278
|
+
protos.google.firestore.v1.ICommitResponse,
|
|
279
|
+
protos.google.firestore.v1.ICommitRequest | undefined,
|
|
280
|
+
{} | undefined
|
|
281
|
+
]>;
|
|
282
|
+
commit(request: protos.google.firestore.v1.ICommitRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.ICommitResponse, protos.google.firestore.v1.ICommitRequest | null | undefined, {} | null | undefined>): void;
|
|
283
|
+
commit(request: protos.google.firestore.v1.ICommitRequest, callback: Callback<protos.google.firestore.v1.ICommitResponse, protos.google.firestore.v1.ICommitRequest | null | undefined, {} | null | undefined>): void;
|
|
284
|
+
/**
|
|
285
|
+
* Rolls back a transaction.
|
|
286
|
+
*
|
|
287
|
+
* @param {Object} request
|
|
288
|
+
* The request object that will be sent.
|
|
289
|
+
* @param {string} request.database
|
|
290
|
+
* Required. The database name. In the format:
|
|
291
|
+
* `projects/{project_id}/databases/{database_id}`.
|
|
292
|
+
* @param {Buffer} request.transaction
|
|
293
|
+
* Required. The transaction to roll back.
|
|
294
|
+
* @param {object} [options]
|
|
295
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
296
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
297
|
+
* The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
|
|
298
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
299
|
+
* for more details and examples.
|
|
300
|
+
* @example <caption>include:samples/generated/v1/firestore.rollback.js</caption>
|
|
301
|
+
* region_tag:firestore_v1_generated_Firestore_Rollback_async
|
|
302
|
+
*/
|
|
303
|
+
rollback(request?: protos.google.firestore.v1.IRollbackRequest, options?: CallOptions): Promise<[
|
|
304
|
+
protos.google.protobuf.IEmpty,
|
|
305
|
+
protos.google.firestore.v1.IRollbackRequest | undefined,
|
|
306
|
+
{} | undefined
|
|
307
|
+
]>;
|
|
308
|
+
rollback(request: protos.google.firestore.v1.IRollbackRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void;
|
|
309
|
+
rollback(request: protos.google.firestore.v1.IRollbackRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void;
|
|
310
|
+
/**
|
|
311
|
+
* Applies a batch of write operations.
|
|
312
|
+
*
|
|
313
|
+
* The BatchWrite method does not apply the write operations atomically
|
|
314
|
+
* and can apply them out of order. Method does not allow more than one write
|
|
315
|
+
* per document. Each write succeeds or fails independently. See the
|
|
316
|
+
* {@link protos.google.firestore.v1.BatchWriteResponse|BatchWriteResponse} for the
|
|
317
|
+
* success status of each write.
|
|
318
|
+
*
|
|
319
|
+
* If you require an atomically applied set of writes, use
|
|
320
|
+
* {@link protos.google.firestore.v1.Firestore.Commit|Commit} instead.
|
|
321
|
+
*
|
|
322
|
+
* @param {Object} request
|
|
323
|
+
* The request object that will be sent.
|
|
324
|
+
* @param {string} request.database
|
|
325
|
+
* Required. The database name. In the format:
|
|
326
|
+
* `projects/{project_id}/databases/{database_id}`.
|
|
327
|
+
* @param {number[]} request.writes
|
|
328
|
+
* The writes to apply.
|
|
329
|
+
*
|
|
330
|
+
* Method does not apply writes atomically and does not guarantee ordering.
|
|
331
|
+
* Each write succeeds or fails independently. You cannot write to the same
|
|
332
|
+
* document more than once per request.
|
|
333
|
+
* @param {number[]} request.labels
|
|
334
|
+
* Labels associated with this batch write.
|
|
335
|
+
* @param {object} [options]
|
|
336
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
337
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
338
|
+
* The first element of the array is an object representing {@link protos.google.firestore.v1.BatchWriteResponse|BatchWriteResponse}.
|
|
339
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
340
|
+
* for more details and examples.
|
|
341
|
+
* @example <caption>include:samples/generated/v1/firestore.batch_write.js</caption>
|
|
342
|
+
* region_tag:firestore_v1_generated_Firestore_BatchWrite_async
|
|
343
|
+
*/
|
|
344
|
+
batchWrite(request?: protos.google.firestore.v1.IBatchWriteRequest, options?: CallOptions): Promise<[
|
|
345
|
+
protos.google.firestore.v1.IBatchWriteResponse,
|
|
346
|
+
protos.google.firestore.v1.IBatchWriteRequest | undefined,
|
|
347
|
+
{} | undefined
|
|
348
|
+
]>;
|
|
349
|
+
batchWrite(request: protos.google.firestore.v1.IBatchWriteRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IBatchWriteResponse, protos.google.firestore.v1.IBatchWriteRequest | null | undefined, {} | null | undefined>): void;
|
|
350
|
+
batchWrite(request: protos.google.firestore.v1.IBatchWriteRequest, callback: Callback<protos.google.firestore.v1.IBatchWriteResponse, protos.google.firestore.v1.IBatchWriteRequest | null | undefined, {} | null | undefined>): void;
|
|
351
|
+
/**
|
|
352
|
+
* Creates a new document.
|
|
353
|
+
*
|
|
354
|
+
* @param {Object} request
|
|
355
|
+
* The request object that will be sent.
|
|
356
|
+
* @param {string} request.parent
|
|
357
|
+
* Required. The parent resource. For example:
|
|
358
|
+
* `projects/{project_id}/databases/{database_id}/documents` or
|
|
359
|
+
* `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
|
|
360
|
+
* @param {string} request.collectionId
|
|
361
|
+
* Required. The collection ID, relative to `parent`, to list. For example:
|
|
362
|
+
* `chatrooms`.
|
|
363
|
+
* @param {string} request.documentId
|
|
364
|
+
* The client-assigned document ID to use for this document.
|
|
365
|
+
*
|
|
366
|
+
* Optional. If not specified, an ID will be assigned by the service.
|
|
367
|
+
* @param {google.firestore.v1.Document} request.document
|
|
368
|
+
* Required. The document to create. `name` must not be set.
|
|
369
|
+
* @param {google.firestore.v1.DocumentMask} request.mask
|
|
370
|
+
* The fields to return. If not set, returns all fields.
|
|
371
|
+
*
|
|
372
|
+
* If the document has a field that is not present in this mask, that field
|
|
373
|
+
* will not be returned in the response.
|
|
374
|
+
* @param {object} [options]
|
|
375
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
376
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
377
|
+
* The first element of the array is an object representing {@link protos.google.firestore.v1.Document|Document}.
|
|
378
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
379
|
+
* for more details and examples.
|
|
380
|
+
* @example <caption>include:samples/generated/v1/firestore.create_document.js</caption>
|
|
381
|
+
* region_tag:firestore_v1_generated_Firestore_CreateDocument_async
|
|
382
|
+
*/
|
|
383
|
+
createDocument(request?: protos.google.firestore.v1.ICreateDocumentRequest, options?: CallOptions): Promise<[
|
|
384
|
+
protos.google.firestore.v1.IDocument,
|
|
385
|
+
protos.google.firestore.v1.ICreateDocumentRequest | undefined,
|
|
386
|
+
{} | undefined
|
|
387
|
+
]>;
|
|
388
|
+
createDocument(request: protos.google.firestore.v1.ICreateDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
389
|
+
createDocument(request: protos.google.firestore.v1.ICreateDocumentRequest, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void;
|
|
390
|
+
/**
|
|
391
|
+
* Gets multiple documents.
|
|
392
|
+
*
|
|
393
|
+
* Documents returned by this method are not guaranteed to be returned in the
|
|
394
|
+
* same order that they were requested.
|
|
395
|
+
*
|
|
396
|
+
* @param {Object} request
|
|
397
|
+
* The request object that will be sent.
|
|
398
|
+
* @param {string} request.database
|
|
399
|
+
* Required. The database name. In the format:
|
|
400
|
+
* `projects/{project_id}/databases/{database_id}`.
|
|
401
|
+
* @param {string[]} request.documents
|
|
402
|
+
* The names of the documents to retrieve. In the format:
|
|
403
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
404
|
+
* The request will fail if any of the document is not a child resource of the
|
|
405
|
+
* given `database`. Duplicate names will be elided.
|
|
406
|
+
* @param {google.firestore.v1.DocumentMask} request.mask
|
|
407
|
+
* The fields to return. If not set, returns all fields.
|
|
408
|
+
*
|
|
409
|
+
* If a document has a field that is not present in this mask, that field will
|
|
410
|
+
* not be returned in the response.
|
|
411
|
+
* @param {Buffer} request.transaction
|
|
412
|
+
* Reads documents in a transaction.
|
|
413
|
+
* @param {google.firestore.v1.TransactionOptions} request.newTransaction
|
|
414
|
+
* Starts a new transaction and reads the documents.
|
|
415
|
+
* Defaults to a read-only transaction.
|
|
416
|
+
* The new transaction ID will be returned as the first response in the
|
|
417
|
+
* stream.
|
|
418
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
419
|
+
* Reads documents as they were at the given time.
|
|
420
|
+
*
|
|
421
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
422
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
423
|
+
* minute timestamp within the past 7 days.
|
|
424
|
+
* @param {object} [options]
|
|
425
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
426
|
+
* @returns {Stream}
|
|
427
|
+
* An object stream which emits {@link protos.google.firestore.v1.BatchGetDocumentsResponse|BatchGetDocumentsResponse} on 'data' event.
|
|
428
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
429
|
+
* for more details and examples.
|
|
430
|
+
* @example <caption>include:samples/generated/v1/firestore.batch_get_documents.js</caption>
|
|
431
|
+
* region_tag:firestore_v1_generated_Firestore_BatchGetDocuments_async
|
|
432
|
+
*/
|
|
433
|
+
batchGetDocuments(request?: protos.google.firestore.v1.IBatchGetDocumentsRequest, options?: CallOptions): gax.CancellableStream;
|
|
434
|
+
/**
|
|
435
|
+
* Runs a query.
|
|
436
|
+
*
|
|
437
|
+
* @param {Object} request
|
|
438
|
+
* The request object that will be sent.
|
|
439
|
+
* @param {string} request.parent
|
|
440
|
+
* Required. The parent resource name. In the format:
|
|
441
|
+
* `projects/{project_id}/databases/{database_id}/documents` or
|
|
442
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
443
|
+
* For example:
|
|
444
|
+
* `projects/my-project/databases/my-database/documents` or
|
|
445
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
446
|
+
* @param {google.firestore.v1.StructuredQuery} request.structuredQuery
|
|
447
|
+
* A structured query.
|
|
448
|
+
* @param {Buffer} request.transaction
|
|
449
|
+
* Run the query within an already active transaction.
|
|
450
|
+
*
|
|
451
|
+
* The value here is the opaque transaction ID to execute the query in.
|
|
452
|
+
* @param {google.firestore.v1.TransactionOptions} request.newTransaction
|
|
453
|
+
* Starts a new transaction and reads the documents.
|
|
454
|
+
* Defaults to a read-only transaction.
|
|
455
|
+
* The new transaction ID will be returned as the first response in the
|
|
456
|
+
* stream.
|
|
457
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
458
|
+
* Reads documents as they were at the given time.
|
|
459
|
+
*
|
|
460
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
461
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
462
|
+
* minute timestamp within the past 7 days.
|
|
463
|
+
* @param {google.firestore.v1.ExplainOptions} [request.explainOptions]
|
|
464
|
+
* Optional. Explain options for the query. If set, additional query
|
|
465
|
+
* statistics will be returned. If not, only query results will be returned.
|
|
466
|
+
* @param {object} [options]
|
|
467
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
468
|
+
* @returns {Stream}
|
|
469
|
+
* An object stream which emits {@link protos.google.firestore.v1.RunQueryResponse|RunQueryResponse} on 'data' event.
|
|
470
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
471
|
+
* for more details and examples.
|
|
472
|
+
* @example <caption>include:samples/generated/v1/firestore.run_query.js</caption>
|
|
473
|
+
* region_tag:firestore_v1_generated_Firestore_RunQuery_async
|
|
474
|
+
*/
|
|
475
|
+
runQuery(request?: protos.google.firestore.v1.IRunQueryRequest, options?: CallOptions): gax.CancellableStream;
|
|
476
|
+
/**
|
|
477
|
+
* Executes a pipeline query.
|
|
478
|
+
*
|
|
479
|
+
* @param {Object} request
|
|
480
|
+
* The request object that will be sent.
|
|
481
|
+
* @param {string} request.database
|
|
482
|
+
* Required. Database identifier, in the form
|
|
483
|
+
* `projects/{project}/databases/{database}`.
|
|
484
|
+
* @param {google.firestore.v1.StructuredPipeline} request.structuredPipeline
|
|
485
|
+
* A pipelined operation.
|
|
486
|
+
* @param {Buffer} request.transaction
|
|
487
|
+
* Run the query within an already active transaction.
|
|
488
|
+
*
|
|
489
|
+
* The value here is the opaque transaction ID to execute the query in.
|
|
490
|
+
* @param {google.firestore.v1.TransactionOptions} request.newTransaction
|
|
491
|
+
* Execute the pipeline in a new transaction.
|
|
492
|
+
*
|
|
493
|
+
* The identifier of the newly created transaction will be returned in the
|
|
494
|
+
* first response on the stream. This defaults to a read-only transaction.
|
|
495
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
496
|
+
* Execute the pipeline in a snapshot transaction at the given time.
|
|
497
|
+
*
|
|
498
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
499
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
500
|
+
* minute timestamp within the past 7 days.
|
|
501
|
+
* @param {boolean} [request.autoCommitTransaction]
|
|
502
|
+
* Optional. Automatically commits the transaction after the pipeline has been
|
|
503
|
+
* executed. Only permitted in combination with `transaction` or
|
|
504
|
+
* `new_transaction`.
|
|
505
|
+
* @param {object} [options]
|
|
506
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
507
|
+
* @returns {Stream}
|
|
508
|
+
* An object stream which emits {@link protos.google.firestore.v1.ExecutePipelineResponse|ExecutePipelineResponse} on 'data' event.
|
|
509
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
510
|
+
* for more details and examples.
|
|
511
|
+
* @example <caption>include:samples/generated/v1/firestore.execute_pipeline.js</caption>
|
|
512
|
+
* region_tag:firestore_v1_generated_Firestore_ExecutePipeline_async
|
|
513
|
+
*/
|
|
514
|
+
executePipeline(request?: protos.google.firestore.v1.IExecutePipelineRequest, options?: CallOptions): gax.CancellableStream;
|
|
515
|
+
/**
|
|
516
|
+
* Runs an aggregation query.
|
|
517
|
+
*
|
|
518
|
+
* Rather than producing {@link protos.google.firestore.v1.Document|Document} results like
|
|
519
|
+
* {@link protos.google.firestore.v1.Firestore.RunQuery|Firestore.RunQuery}, this API
|
|
520
|
+
* allows running an aggregation to produce a series of
|
|
521
|
+
* {@link protos.google.firestore.v1.AggregationResult|AggregationResult} server-side.
|
|
522
|
+
*
|
|
523
|
+
* High-Level Example:
|
|
524
|
+
*
|
|
525
|
+
* ```
|
|
526
|
+
* -- Return the number of documents in table given a filter.
|
|
527
|
+
* SELECT COUNT(*) FROM ( SELECT * FROM k where a = true );
|
|
528
|
+
* ```
|
|
529
|
+
*
|
|
530
|
+
* @param {Object} request
|
|
531
|
+
* The request object that will be sent.
|
|
532
|
+
* @param {string} request.parent
|
|
533
|
+
* Required. The parent resource name. In the format:
|
|
534
|
+
* `projects/{project_id}/databases/{database_id}/documents` or
|
|
535
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
536
|
+
* For example:
|
|
537
|
+
* `projects/my-project/databases/my-database/documents` or
|
|
538
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
539
|
+
* @param {google.firestore.v1.StructuredAggregationQuery} request.structuredAggregationQuery
|
|
540
|
+
* An aggregation query.
|
|
541
|
+
* @param {Buffer} request.transaction
|
|
542
|
+
* Run the aggregation within an already active transaction.
|
|
543
|
+
*
|
|
544
|
+
* The value here is the opaque transaction ID to execute the query in.
|
|
545
|
+
* @param {google.firestore.v1.TransactionOptions} request.newTransaction
|
|
546
|
+
* Starts a new transaction as part of the query, defaulting to read-only.
|
|
547
|
+
*
|
|
548
|
+
* The new transaction ID will be returned as the first response in the
|
|
549
|
+
* stream.
|
|
550
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
551
|
+
* Executes the query at the given timestamp.
|
|
552
|
+
*
|
|
553
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
554
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
555
|
+
* minute timestamp within the past 7 days.
|
|
556
|
+
* @param {google.firestore.v1.ExplainOptions} [request.explainOptions]
|
|
557
|
+
* Optional. Explain options for the query. If set, additional query
|
|
558
|
+
* statistics will be returned. If not, only query results will be returned.
|
|
559
|
+
* @param {object} [options]
|
|
560
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
561
|
+
* @returns {Stream}
|
|
562
|
+
* An object stream which emits {@link protos.google.firestore.v1.RunAggregationQueryResponse|RunAggregationQueryResponse} on 'data' event.
|
|
563
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
564
|
+
* for more details and examples.
|
|
565
|
+
* @example <caption>include:samples/generated/v1/firestore.run_aggregation_query.js</caption>
|
|
566
|
+
* region_tag:firestore_v1_generated_Firestore_RunAggregationQuery_async
|
|
567
|
+
*/
|
|
568
|
+
runAggregationQuery(request?: protos.google.firestore.v1.IRunAggregationQueryRequest, options?: CallOptions): gax.CancellableStream;
|
|
569
|
+
/**
|
|
570
|
+
* Streams batches of document updates and deletes, in order. This method is
|
|
571
|
+
* only available via gRPC or WebChannel (not REST).
|
|
572
|
+
*
|
|
573
|
+
* @param {object} [options]
|
|
574
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
575
|
+
* @returns {Stream}
|
|
576
|
+
* An object stream which is both readable and writable. It accepts objects
|
|
577
|
+
* representing {@link protos.google.firestore.v1.WriteRequest|WriteRequest} for write() method, and
|
|
578
|
+
* will emit objects representing {@link protos.google.firestore.v1.WriteResponse|WriteResponse} on 'data' event asynchronously.
|
|
579
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation }
|
|
580
|
+
* for more details and examples.
|
|
581
|
+
* @example <caption>include:samples/generated/v1/firestore.write.js</caption>
|
|
582
|
+
* region_tag:firestore_v1_generated_Firestore_Write_async
|
|
583
|
+
*/
|
|
584
|
+
write(options?: CallOptions): gax.CancellableStream;
|
|
585
|
+
/**
|
|
586
|
+
* Listens to changes. This method is only available via gRPC or WebChannel
|
|
587
|
+
* (not REST).
|
|
588
|
+
*
|
|
589
|
+
* @param {object} [options]
|
|
590
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
591
|
+
* @returns {Stream}
|
|
592
|
+
* An object stream which is both readable and writable. It accepts objects
|
|
593
|
+
* representing {@link protos.google.firestore.v1.ListenRequest|ListenRequest} for write() method, and
|
|
594
|
+
* will emit objects representing {@link protos.google.firestore.v1.ListenResponse|ListenResponse} on 'data' event asynchronously.
|
|
595
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation }
|
|
596
|
+
* for more details and examples.
|
|
597
|
+
* @example <caption>include:samples/generated/v1/firestore.listen.js</caption>
|
|
598
|
+
* region_tag:firestore_v1_generated_Firestore_Listen_async
|
|
599
|
+
*/
|
|
600
|
+
listen(options?: CallOptions): gax.CancellableStream;
|
|
601
|
+
/**
|
|
602
|
+
* Lists documents.
|
|
603
|
+
*
|
|
604
|
+
* @param {Object} request
|
|
605
|
+
* The request object that will be sent.
|
|
606
|
+
* @param {string} request.parent
|
|
607
|
+
* Required. The parent resource name. In the format:
|
|
608
|
+
* `projects/{project_id}/databases/{database_id}/documents` or
|
|
609
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
610
|
+
*
|
|
611
|
+
* For example:
|
|
612
|
+
* `projects/my-project/databases/my-database/documents` or
|
|
613
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
614
|
+
* @param {string} [request.collectionId]
|
|
615
|
+
* Optional. The collection ID, relative to `parent`, to list.
|
|
616
|
+
*
|
|
617
|
+
* For example: `chatrooms` or `messages`.
|
|
618
|
+
*
|
|
619
|
+
* This is optional, and when not provided, Firestore will list documents
|
|
620
|
+
* from all collections under the provided `parent`.
|
|
621
|
+
* @param {number} [request.pageSize]
|
|
622
|
+
* Optional. The maximum number of documents to return in a single response.
|
|
623
|
+
*
|
|
624
|
+
* Firestore may return fewer than this value.
|
|
625
|
+
* @param {string} [request.pageToken]
|
|
626
|
+
* Optional. A page token, received from a previous `ListDocuments` response.
|
|
627
|
+
*
|
|
628
|
+
* Provide this to retrieve the subsequent page. When paginating, all other
|
|
629
|
+
* parameters (with the exception of `page_size`) must match the values set
|
|
630
|
+
* in the request that generated the page token.
|
|
631
|
+
* @param {string} [request.orderBy]
|
|
632
|
+
* Optional. The optional ordering of the documents to return.
|
|
633
|
+
*
|
|
634
|
+
* For example: `priority desc, __name__ desc`.
|
|
635
|
+
*
|
|
636
|
+
* This mirrors the {@link protos.google.firestore.v1.StructuredQuery.order_by|`ORDER BY`}
|
|
637
|
+
* used in Firestore queries but in a string representation. When absent,
|
|
638
|
+
* documents are ordered based on `__name__ ASC`.
|
|
639
|
+
* @param {google.firestore.v1.DocumentMask} [request.mask]
|
|
640
|
+
* Optional. The fields to return. If not set, returns all fields.
|
|
641
|
+
*
|
|
642
|
+
* If a document has a field that is not present in this mask, that field
|
|
643
|
+
* will not be returned in the response.
|
|
644
|
+
* @param {Buffer} request.transaction
|
|
645
|
+
* Perform the read as part of an already active transaction.
|
|
646
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
647
|
+
* Perform the read at the provided time.
|
|
648
|
+
*
|
|
649
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
650
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
651
|
+
* minute timestamp within the past 7 days.
|
|
652
|
+
* @param {boolean} request.showMissing
|
|
653
|
+
* If the list should show missing documents.
|
|
654
|
+
*
|
|
655
|
+
* A document is missing if it does not exist, but there are sub-documents
|
|
656
|
+
* nested underneath it. When true, such missing documents will be returned
|
|
657
|
+
* with a key but will not have fields,
|
|
658
|
+
* {@link protos.google.firestore.v1.Document.create_time|`create_time`}, or
|
|
659
|
+
* {@link protos.google.firestore.v1.Document.update_time|`update_time`} set.
|
|
660
|
+
*
|
|
661
|
+
* Requests with `show_missing` may not specify `where` or `order_by`.
|
|
662
|
+
* @param {object} [options]
|
|
663
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
664
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
665
|
+
* The first element of the array is Array of {@link protos.google.firestore.v1.Document|Document}.
|
|
666
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
667
|
+
* times as needed and will merge results from all the pages into this array.
|
|
668
|
+
* Note that it can affect your quota.
|
|
669
|
+
* We recommend using `listDocumentsAsync()`
|
|
670
|
+
* method described below for async iteration which you can stop as needed.
|
|
671
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
672
|
+
* for more details and examples.
|
|
673
|
+
*/
|
|
674
|
+
listDocuments(request?: protos.google.firestore.v1.IListDocumentsRequest, options?: CallOptions): Promise<[
|
|
675
|
+
protos.google.firestore.v1.IDocument[],
|
|
676
|
+
protos.google.firestore.v1.IListDocumentsRequest | null,
|
|
677
|
+
protos.google.firestore.v1.IListDocumentsResponse
|
|
678
|
+
]>;
|
|
679
|
+
listDocuments(request: protos.google.firestore.v1.IListDocumentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IListDocumentsRequest, protos.google.firestore.v1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1.IDocument>): void;
|
|
680
|
+
listDocuments(request: protos.google.firestore.v1.IListDocumentsRequest, callback: PaginationCallback<protos.google.firestore.v1.IListDocumentsRequest, protos.google.firestore.v1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1.IDocument>): void;
|
|
681
|
+
/**
|
|
682
|
+
* Equivalent to `listDocuments`, but returns a NodeJS Stream object.
|
|
683
|
+
* @param {Object} request
|
|
684
|
+
* The request object that will be sent.
|
|
685
|
+
* @param {string} request.parent
|
|
686
|
+
* Required. The parent resource name. In the format:
|
|
687
|
+
* `projects/{project_id}/databases/{database_id}/documents` or
|
|
688
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
689
|
+
*
|
|
690
|
+
* For example:
|
|
691
|
+
* `projects/my-project/databases/my-database/documents` or
|
|
692
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
693
|
+
* @param {string} [request.collectionId]
|
|
694
|
+
* Optional. The collection ID, relative to `parent`, to list.
|
|
695
|
+
*
|
|
696
|
+
* For example: `chatrooms` or `messages`.
|
|
697
|
+
*
|
|
698
|
+
* This is optional, and when not provided, Firestore will list documents
|
|
699
|
+
* from all collections under the provided `parent`.
|
|
700
|
+
* @param {number} [request.pageSize]
|
|
701
|
+
* Optional. The maximum number of documents to return in a single response.
|
|
702
|
+
*
|
|
703
|
+
* Firestore may return fewer than this value.
|
|
704
|
+
* @param {string} [request.pageToken]
|
|
705
|
+
* Optional. A page token, received from a previous `ListDocuments` response.
|
|
706
|
+
*
|
|
707
|
+
* Provide this to retrieve the subsequent page. When paginating, all other
|
|
708
|
+
* parameters (with the exception of `page_size`) must match the values set
|
|
709
|
+
* in the request that generated the page token.
|
|
710
|
+
* @param {string} [request.orderBy]
|
|
711
|
+
* Optional. The optional ordering of the documents to return.
|
|
712
|
+
*
|
|
713
|
+
* For example: `priority desc, __name__ desc`.
|
|
714
|
+
*
|
|
715
|
+
* This mirrors the {@link protos.google.firestore.v1.StructuredQuery.order_by|`ORDER BY`}
|
|
716
|
+
* used in Firestore queries but in a string representation. When absent,
|
|
717
|
+
* documents are ordered based on `__name__ ASC`.
|
|
718
|
+
* @param {google.firestore.v1.DocumentMask} [request.mask]
|
|
719
|
+
* Optional. The fields to return. If not set, returns all fields.
|
|
720
|
+
*
|
|
721
|
+
* If a document has a field that is not present in this mask, that field
|
|
722
|
+
* will not be returned in the response.
|
|
723
|
+
* @param {Buffer} request.transaction
|
|
724
|
+
* Perform the read as part of an already active transaction.
|
|
725
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
726
|
+
* Perform the read at the provided time.
|
|
727
|
+
*
|
|
728
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
729
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
730
|
+
* minute timestamp within the past 7 days.
|
|
731
|
+
* @param {boolean} request.showMissing
|
|
732
|
+
* If the list should show missing documents.
|
|
733
|
+
*
|
|
734
|
+
* A document is missing if it does not exist, but there are sub-documents
|
|
735
|
+
* nested underneath it. When true, such missing documents will be returned
|
|
736
|
+
* with a key but will not have fields,
|
|
737
|
+
* {@link protos.google.firestore.v1.Document.create_time|`create_time`}, or
|
|
738
|
+
* {@link protos.google.firestore.v1.Document.update_time|`update_time`} set.
|
|
739
|
+
*
|
|
740
|
+
* Requests with `show_missing` may not specify `where` or `order_by`.
|
|
741
|
+
* @param {object} [options]
|
|
742
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
743
|
+
* @returns {Stream}
|
|
744
|
+
* An object stream which emits an object representing {@link protos.google.firestore.v1.Document|Document} on 'data' event.
|
|
745
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
746
|
+
* times as needed. Note that it can affect your quota.
|
|
747
|
+
* We recommend using `listDocumentsAsync()`
|
|
748
|
+
* method described below for async iteration which you can stop as needed.
|
|
749
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
750
|
+
* for more details and examples.
|
|
751
|
+
*/
|
|
752
|
+
listDocumentsStream(request?: protos.google.firestore.v1.IListDocumentsRequest, options?: CallOptions): Transform;
|
|
753
|
+
/**
|
|
754
|
+
* Equivalent to `listDocuments`, but returns an iterable object.
|
|
755
|
+
*
|
|
756
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
757
|
+
* @param {Object} request
|
|
758
|
+
* The request object that will be sent.
|
|
759
|
+
* @param {string} request.parent
|
|
760
|
+
* Required. The parent resource name. In the format:
|
|
761
|
+
* `projects/{project_id}/databases/{database_id}/documents` or
|
|
762
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
763
|
+
*
|
|
764
|
+
* For example:
|
|
765
|
+
* `projects/my-project/databases/my-database/documents` or
|
|
766
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
767
|
+
* @param {string} [request.collectionId]
|
|
768
|
+
* Optional. The collection ID, relative to `parent`, to list.
|
|
769
|
+
*
|
|
770
|
+
* For example: `chatrooms` or `messages`.
|
|
771
|
+
*
|
|
772
|
+
* This is optional, and when not provided, Firestore will list documents
|
|
773
|
+
* from all collections under the provided `parent`.
|
|
774
|
+
* @param {number} [request.pageSize]
|
|
775
|
+
* Optional. The maximum number of documents to return in a single response.
|
|
776
|
+
*
|
|
777
|
+
* Firestore may return fewer than this value.
|
|
778
|
+
* @param {string} [request.pageToken]
|
|
779
|
+
* Optional. A page token, received from a previous `ListDocuments` response.
|
|
780
|
+
*
|
|
781
|
+
* Provide this to retrieve the subsequent page. When paginating, all other
|
|
782
|
+
* parameters (with the exception of `page_size`) must match the values set
|
|
783
|
+
* in the request that generated the page token.
|
|
784
|
+
* @param {string} [request.orderBy]
|
|
785
|
+
* Optional. The optional ordering of the documents to return.
|
|
786
|
+
*
|
|
787
|
+
* For example: `priority desc, __name__ desc`.
|
|
788
|
+
*
|
|
789
|
+
* This mirrors the {@link protos.google.firestore.v1.StructuredQuery.order_by|`ORDER BY`}
|
|
790
|
+
* used in Firestore queries but in a string representation. When absent,
|
|
791
|
+
* documents are ordered based on `__name__ ASC`.
|
|
792
|
+
* @param {google.firestore.v1.DocumentMask} [request.mask]
|
|
793
|
+
* Optional. The fields to return. If not set, returns all fields.
|
|
794
|
+
*
|
|
795
|
+
* If a document has a field that is not present in this mask, that field
|
|
796
|
+
* will not be returned in the response.
|
|
797
|
+
* @param {Buffer} request.transaction
|
|
798
|
+
* Perform the read as part of an already active transaction.
|
|
799
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
800
|
+
* Perform the read at the provided time.
|
|
801
|
+
*
|
|
802
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
803
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
804
|
+
* minute timestamp within the past 7 days.
|
|
805
|
+
* @param {boolean} request.showMissing
|
|
806
|
+
* If the list should show missing documents.
|
|
807
|
+
*
|
|
808
|
+
* A document is missing if it does not exist, but there are sub-documents
|
|
809
|
+
* nested underneath it. When true, such missing documents will be returned
|
|
810
|
+
* with a key but will not have fields,
|
|
811
|
+
* {@link protos.google.firestore.v1.Document.create_time|`create_time`}, or
|
|
812
|
+
* {@link protos.google.firestore.v1.Document.update_time|`update_time`} set.
|
|
813
|
+
*
|
|
814
|
+
* Requests with `show_missing` may not specify `where` or `order_by`.
|
|
815
|
+
* @param {object} [options]
|
|
816
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
817
|
+
* @returns {Object}
|
|
818
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
819
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
820
|
+
* {@link protos.google.firestore.v1.Document|Document}. The API will be called under the hood as needed, once per the page,
|
|
821
|
+
* so you can stop the iteration when you don't need more results.
|
|
822
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
823
|
+
* for more details and examples.
|
|
824
|
+
* @example <caption>include:samples/generated/v1/firestore.list_documents.js</caption>
|
|
825
|
+
* region_tag:firestore_v1_generated_Firestore_ListDocuments_async
|
|
826
|
+
*/
|
|
827
|
+
listDocumentsAsync(request?: protos.google.firestore.v1.IListDocumentsRequest, options?: CallOptions): AsyncIterable<protos.google.firestore.v1.IDocument>;
|
|
828
|
+
/**
|
|
829
|
+
* Partitions a query by returning partition cursors that can be used to run
|
|
830
|
+
* the query in parallel. The returned partition cursors are split points that
|
|
831
|
+
* can be used by RunQuery as starting/end points for the query results.
|
|
832
|
+
*
|
|
833
|
+
* @param {Object} request
|
|
834
|
+
* The request object that will be sent.
|
|
835
|
+
* @param {string} request.parent
|
|
836
|
+
* Required. The parent resource name. In the format:
|
|
837
|
+
* `projects/{project_id}/databases/{database_id}/documents`.
|
|
838
|
+
* Document resource names are not supported; only database resource names
|
|
839
|
+
* can be specified.
|
|
840
|
+
* @param {google.firestore.v1.StructuredQuery} request.structuredQuery
|
|
841
|
+
* A structured query.
|
|
842
|
+
* Query must specify collection with all descendants and be ordered by name
|
|
843
|
+
* ascending. Other filters, order bys, limits, offsets, and start/end
|
|
844
|
+
* cursors are not supported.
|
|
845
|
+
* @param {number} request.partitionCount
|
|
846
|
+
* The desired maximum number of partition points.
|
|
847
|
+
* The partitions may be returned across multiple pages of results.
|
|
848
|
+
* The number must be positive. The actual number of partitions
|
|
849
|
+
* returned may be fewer.
|
|
850
|
+
*
|
|
851
|
+
* For example, this may be set to one fewer than the number of parallel
|
|
852
|
+
* queries to be run, or in running a data pipeline job, one fewer than the
|
|
853
|
+
* number of workers or compute instances available.
|
|
854
|
+
* @param {string} request.pageToken
|
|
855
|
+
* The `next_page_token` value returned from a previous call to
|
|
856
|
+
* PartitionQuery that may be used to get an additional set of results.
|
|
857
|
+
* There are no ordering guarantees between sets of results. Thus, using
|
|
858
|
+
* multiple sets of results will require merging the different result sets.
|
|
859
|
+
*
|
|
860
|
+
* For example, two subsequent calls using a page_token may return:
|
|
861
|
+
*
|
|
862
|
+
* * cursor B, cursor M, cursor Q
|
|
863
|
+
* * cursor A, cursor U, cursor W
|
|
864
|
+
*
|
|
865
|
+
* To obtain a complete result set ordered with respect to the results of the
|
|
866
|
+
* query supplied to PartitionQuery, the results sets should be merged:
|
|
867
|
+
* cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W
|
|
868
|
+
* @param {number} request.pageSize
|
|
869
|
+
* The maximum number of partitions to return in this call, subject to
|
|
870
|
+
* `partition_count`.
|
|
871
|
+
*
|
|
872
|
+
* For example, if `partition_count` = 10 and `page_size` = 8, the first call
|
|
873
|
+
* to PartitionQuery will return up to 8 partitions and a `next_page_token`
|
|
874
|
+
* if more results exist. A second call to PartitionQuery will return up to
|
|
875
|
+
* 2 partitions, to complete the total of 10 specified in `partition_count`.
|
|
876
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
877
|
+
* Reads documents as they were at the given time.
|
|
878
|
+
*
|
|
879
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
880
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
881
|
+
* minute timestamp within the past 7 days.
|
|
882
|
+
* @param {object} [options]
|
|
883
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
884
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
885
|
+
* The first element of the array is Array of {@link protos.google.firestore.v1.Cursor|Cursor}.
|
|
886
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
887
|
+
* times as needed and will merge results from all the pages into this array.
|
|
888
|
+
* Note that it can affect your quota.
|
|
889
|
+
* We recommend using `partitionQueryAsync()`
|
|
890
|
+
* method described below for async iteration which you can stop as needed.
|
|
891
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
892
|
+
* for more details and examples.
|
|
893
|
+
*/
|
|
894
|
+
partitionQuery(request?: protos.google.firestore.v1.IPartitionQueryRequest, options?: CallOptions): Promise<[
|
|
895
|
+
protos.google.firestore.v1.ICursor[],
|
|
896
|
+
protos.google.firestore.v1.IPartitionQueryRequest | null,
|
|
897
|
+
protos.google.firestore.v1.IPartitionQueryResponse
|
|
898
|
+
]>;
|
|
899
|
+
partitionQuery(request: protos.google.firestore.v1.IPartitionQueryRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IPartitionQueryRequest, protos.google.firestore.v1.IPartitionQueryResponse | null | undefined, protos.google.firestore.v1.ICursor>): void;
|
|
900
|
+
partitionQuery(request: protos.google.firestore.v1.IPartitionQueryRequest, callback: PaginationCallback<protos.google.firestore.v1.IPartitionQueryRequest, protos.google.firestore.v1.IPartitionQueryResponse | null | undefined, protos.google.firestore.v1.ICursor>): void;
|
|
901
|
+
/**
|
|
902
|
+
* Equivalent to `partitionQuery`, but returns a NodeJS Stream object.
|
|
903
|
+
* @param {Object} request
|
|
904
|
+
* The request object that will be sent.
|
|
905
|
+
* @param {string} request.parent
|
|
906
|
+
* Required. The parent resource name. In the format:
|
|
907
|
+
* `projects/{project_id}/databases/{database_id}/documents`.
|
|
908
|
+
* Document resource names are not supported; only database resource names
|
|
909
|
+
* can be specified.
|
|
910
|
+
* @param {google.firestore.v1.StructuredQuery} request.structuredQuery
|
|
911
|
+
* A structured query.
|
|
912
|
+
* Query must specify collection with all descendants and be ordered by name
|
|
913
|
+
* ascending. Other filters, order bys, limits, offsets, and start/end
|
|
914
|
+
* cursors are not supported.
|
|
915
|
+
* @param {number} request.partitionCount
|
|
916
|
+
* The desired maximum number of partition points.
|
|
917
|
+
* The partitions may be returned across multiple pages of results.
|
|
918
|
+
* The number must be positive. The actual number of partitions
|
|
919
|
+
* returned may be fewer.
|
|
920
|
+
*
|
|
921
|
+
* For example, this may be set to one fewer than the number of parallel
|
|
922
|
+
* queries to be run, or in running a data pipeline job, one fewer than the
|
|
923
|
+
* number of workers or compute instances available.
|
|
924
|
+
* @param {string} request.pageToken
|
|
925
|
+
* The `next_page_token` value returned from a previous call to
|
|
926
|
+
* PartitionQuery that may be used to get an additional set of results.
|
|
927
|
+
* There are no ordering guarantees between sets of results. Thus, using
|
|
928
|
+
* multiple sets of results will require merging the different result sets.
|
|
929
|
+
*
|
|
930
|
+
* For example, two subsequent calls using a page_token may return:
|
|
931
|
+
*
|
|
932
|
+
* * cursor B, cursor M, cursor Q
|
|
933
|
+
* * cursor A, cursor U, cursor W
|
|
934
|
+
*
|
|
935
|
+
* To obtain a complete result set ordered with respect to the results of the
|
|
936
|
+
* query supplied to PartitionQuery, the results sets should be merged:
|
|
937
|
+
* cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W
|
|
938
|
+
* @param {number} request.pageSize
|
|
939
|
+
* The maximum number of partitions to return in this call, subject to
|
|
940
|
+
* `partition_count`.
|
|
941
|
+
*
|
|
942
|
+
* For example, if `partition_count` = 10 and `page_size` = 8, the first call
|
|
943
|
+
* to PartitionQuery will return up to 8 partitions and a `next_page_token`
|
|
944
|
+
* if more results exist. A second call to PartitionQuery will return up to
|
|
945
|
+
* 2 partitions, to complete the total of 10 specified in `partition_count`.
|
|
946
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
947
|
+
* Reads documents as they were at the given time.
|
|
948
|
+
*
|
|
949
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
950
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
951
|
+
* minute timestamp within the past 7 days.
|
|
952
|
+
* @param {object} [options]
|
|
953
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
954
|
+
* @returns {Stream}
|
|
955
|
+
* An object stream which emits an object representing {@link protos.google.firestore.v1.Cursor|Cursor} on 'data' event.
|
|
956
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
957
|
+
* times as needed. Note that it can affect your quota.
|
|
958
|
+
* We recommend using `partitionQueryAsync()`
|
|
959
|
+
* method described below for async iteration which you can stop as needed.
|
|
960
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
961
|
+
* for more details and examples.
|
|
962
|
+
*/
|
|
963
|
+
partitionQueryStream(request?: protos.google.firestore.v1.IPartitionQueryRequest, options?: CallOptions): Transform;
|
|
964
|
+
/**
|
|
965
|
+
* Equivalent to `partitionQuery`, but returns an iterable object.
|
|
966
|
+
*
|
|
967
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
968
|
+
* @param {Object} request
|
|
969
|
+
* The request object that will be sent.
|
|
970
|
+
* @param {string} request.parent
|
|
971
|
+
* Required. The parent resource name. In the format:
|
|
972
|
+
* `projects/{project_id}/databases/{database_id}/documents`.
|
|
973
|
+
* Document resource names are not supported; only database resource names
|
|
974
|
+
* can be specified.
|
|
975
|
+
* @param {google.firestore.v1.StructuredQuery} request.structuredQuery
|
|
976
|
+
* A structured query.
|
|
977
|
+
* Query must specify collection with all descendants and be ordered by name
|
|
978
|
+
* ascending. Other filters, order bys, limits, offsets, and start/end
|
|
979
|
+
* cursors are not supported.
|
|
980
|
+
* @param {number} request.partitionCount
|
|
981
|
+
* The desired maximum number of partition points.
|
|
982
|
+
* The partitions may be returned across multiple pages of results.
|
|
983
|
+
* The number must be positive. The actual number of partitions
|
|
984
|
+
* returned may be fewer.
|
|
985
|
+
*
|
|
986
|
+
* For example, this may be set to one fewer than the number of parallel
|
|
987
|
+
* queries to be run, or in running a data pipeline job, one fewer than the
|
|
988
|
+
* number of workers or compute instances available.
|
|
989
|
+
* @param {string} request.pageToken
|
|
990
|
+
* The `next_page_token` value returned from a previous call to
|
|
991
|
+
* PartitionQuery that may be used to get an additional set of results.
|
|
992
|
+
* There are no ordering guarantees between sets of results. Thus, using
|
|
993
|
+
* multiple sets of results will require merging the different result sets.
|
|
994
|
+
*
|
|
995
|
+
* For example, two subsequent calls using a page_token may return:
|
|
996
|
+
*
|
|
997
|
+
* * cursor B, cursor M, cursor Q
|
|
998
|
+
* * cursor A, cursor U, cursor W
|
|
999
|
+
*
|
|
1000
|
+
* To obtain a complete result set ordered with respect to the results of the
|
|
1001
|
+
* query supplied to PartitionQuery, the results sets should be merged:
|
|
1002
|
+
* cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W
|
|
1003
|
+
* @param {number} request.pageSize
|
|
1004
|
+
* The maximum number of partitions to return in this call, subject to
|
|
1005
|
+
* `partition_count`.
|
|
1006
|
+
*
|
|
1007
|
+
* For example, if `partition_count` = 10 and `page_size` = 8, the first call
|
|
1008
|
+
* to PartitionQuery will return up to 8 partitions and a `next_page_token`
|
|
1009
|
+
* if more results exist. A second call to PartitionQuery will return up to
|
|
1010
|
+
* 2 partitions, to complete the total of 10 specified in `partition_count`.
|
|
1011
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
1012
|
+
* Reads documents as they were at the given time.
|
|
1013
|
+
*
|
|
1014
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
1015
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
1016
|
+
* minute timestamp within the past 7 days.
|
|
1017
|
+
* @param {object} [options]
|
|
1018
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1019
|
+
* @returns {Object}
|
|
1020
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
1021
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
1022
|
+
* {@link protos.google.firestore.v1.Cursor|Cursor}. The API will be called under the hood as needed, once per the page,
|
|
1023
|
+
* so you can stop the iteration when you don't need more results.
|
|
1024
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1025
|
+
* for more details and examples.
|
|
1026
|
+
* @example <caption>include:samples/generated/v1/firestore.partition_query.js</caption>
|
|
1027
|
+
* region_tag:firestore_v1_generated_Firestore_PartitionQuery_async
|
|
1028
|
+
*/
|
|
1029
|
+
partitionQueryAsync(request?: protos.google.firestore.v1.IPartitionQueryRequest, options?: CallOptions): AsyncIterable<protos.google.firestore.v1.ICursor>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Lists all the collection IDs underneath a document.
|
|
1032
|
+
*
|
|
1033
|
+
* @param {Object} request
|
|
1034
|
+
* The request object that will be sent.
|
|
1035
|
+
* @param {string} request.parent
|
|
1036
|
+
* Required. The parent document. In the format:
|
|
1037
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
1038
|
+
* For example:
|
|
1039
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
1040
|
+
*
|
|
1041
|
+
* Use `projects/{project_id}/databases/{database_id}/documents` to list
|
|
1042
|
+
* top-level collections.
|
|
1043
|
+
* @param {number} request.pageSize
|
|
1044
|
+
* The maximum number of results to return.
|
|
1045
|
+
* @param {string} request.pageToken
|
|
1046
|
+
* A page token. Must be a value from
|
|
1047
|
+
* {@link protos.google.firestore.v1.ListCollectionIdsResponse|ListCollectionIdsResponse}.
|
|
1048
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
1049
|
+
* Reads documents as they were at the given time.
|
|
1050
|
+
*
|
|
1051
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
1052
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
1053
|
+
* minute timestamp within the past 7 days.
|
|
1054
|
+
* @param {object} [options]
|
|
1055
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1056
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
1057
|
+
* The first element of the array is Array of string.
|
|
1058
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1059
|
+
* times as needed and will merge results from all the pages into this array.
|
|
1060
|
+
* Note that it can affect your quota.
|
|
1061
|
+
* We recommend using `listCollectionIdsAsync()`
|
|
1062
|
+
* method described below for async iteration which you can stop as needed.
|
|
1063
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1064
|
+
* for more details and examples.
|
|
1065
|
+
*/
|
|
1066
|
+
listCollectionIds(request?: protos.google.firestore.v1.IListCollectionIdsRequest, options?: CallOptions): Promise<[
|
|
1067
|
+
string[],
|
|
1068
|
+
protos.google.firestore.v1.IListCollectionIdsRequest | null,
|
|
1069
|
+
protos.google.firestore.v1.IListCollectionIdsResponse
|
|
1070
|
+
]>;
|
|
1071
|
+
listCollectionIds(request: protos.google.firestore.v1.IListCollectionIdsRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IListCollectionIdsRequest, protos.google.firestore.v1.IListCollectionIdsResponse | null | undefined, string>): void;
|
|
1072
|
+
listCollectionIds(request: protos.google.firestore.v1.IListCollectionIdsRequest, callback: PaginationCallback<protos.google.firestore.v1.IListCollectionIdsRequest, protos.google.firestore.v1.IListCollectionIdsResponse | null | undefined, string>): void;
|
|
1073
|
+
/**
|
|
1074
|
+
* Equivalent to `listCollectionIds`, but returns a NodeJS Stream object.
|
|
1075
|
+
* @param {Object} request
|
|
1076
|
+
* The request object that will be sent.
|
|
1077
|
+
* @param {string} request.parent
|
|
1078
|
+
* Required. The parent document. In the format:
|
|
1079
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
1080
|
+
* For example:
|
|
1081
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
1082
|
+
*
|
|
1083
|
+
* Use `projects/{project_id}/databases/{database_id}/documents` to list
|
|
1084
|
+
* top-level collections.
|
|
1085
|
+
* @param {number} request.pageSize
|
|
1086
|
+
* The maximum number of results to return.
|
|
1087
|
+
* @param {string} request.pageToken
|
|
1088
|
+
* A page token. Must be a value from
|
|
1089
|
+
* {@link protos.google.firestore.v1.ListCollectionIdsResponse|ListCollectionIdsResponse}.
|
|
1090
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
1091
|
+
* Reads documents as they were at the given time.
|
|
1092
|
+
*
|
|
1093
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
1094
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
1095
|
+
* minute timestamp within the past 7 days.
|
|
1096
|
+
* @param {object} [options]
|
|
1097
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1098
|
+
* @returns {Stream}
|
|
1099
|
+
* An object stream which emits an object representing string on 'data' event.
|
|
1100
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1101
|
+
* times as needed. Note that it can affect your quota.
|
|
1102
|
+
* We recommend using `listCollectionIdsAsync()`
|
|
1103
|
+
* method described below for async iteration which you can stop as needed.
|
|
1104
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1105
|
+
* for more details and examples.
|
|
1106
|
+
*/
|
|
1107
|
+
listCollectionIdsStream(request?: protos.google.firestore.v1.IListCollectionIdsRequest, options?: CallOptions): Transform;
|
|
1108
|
+
/**
|
|
1109
|
+
* Equivalent to `listCollectionIds`, but returns an iterable object.
|
|
1110
|
+
*
|
|
1111
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
1112
|
+
* @param {Object} request
|
|
1113
|
+
* The request object that will be sent.
|
|
1114
|
+
* @param {string} request.parent
|
|
1115
|
+
* Required. The parent document. In the format:
|
|
1116
|
+
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
|
1117
|
+
* For example:
|
|
1118
|
+
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
|
1119
|
+
*
|
|
1120
|
+
* Use `projects/{project_id}/databases/{database_id}/documents` to list
|
|
1121
|
+
* top-level collections.
|
|
1122
|
+
* @param {number} request.pageSize
|
|
1123
|
+
* The maximum number of results to return.
|
|
1124
|
+
* @param {string} request.pageToken
|
|
1125
|
+
* A page token. Must be a value from
|
|
1126
|
+
* {@link protos.google.firestore.v1.ListCollectionIdsResponse|ListCollectionIdsResponse}.
|
|
1127
|
+
* @param {google.protobuf.Timestamp} request.readTime
|
|
1128
|
+
* Reads documents as they were at the given time.
|
|
1129
|
+
*
|
|
1130
|
+
* This must be a microsecond precision timestamp within the past one hour,
|
|
1131
|
+
* or if Point-in-Time Recovery is enabled, can additionally be a whole
|
|
1132
|
+
* minute timestamp within the past 7 days.
|
|
1133
|
+
* @param {object} [options]
|
|
1134
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1135
|
+
* @returns {Object}
|
|
1136
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
1137
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
1138
|
+
* string. The API will be called under the hood as needed, once per the page,
|
|
1139
|
+
* so you can stop the iteration when you don't need more results.
|
|
1140
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1141
|
+
* for more details and examples.
|
|
1142
|
+
* @example <caption>include:samples/generated/v1/firestore.list_collection_ids.js</caption>
|
|
1143
|
+
* region_tag:firestore_v1_generated_Firestore_ListCollectionIds_async
|
|
1144
|
+
*/
|
|
1145
|
+
listCollectionIdsAsync(request?: protos.google.firestore.v1.IListCollectionIdsRequest, options?: CallOptions): AsyncIterable<string>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Gets information about a location.
|
|
1148
|
+
*
|
|
1149
|
+
* @param {Object} request
|
|
1150
|
+
* The request object that will be sent.
|
|
1151
|
+
* @param {string} request.name
|
|
1152
|
+
* Resource name for the location.
|
|
1153
|
+
* @param {object} [options]
|
|
1154
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
|
1155
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
1156
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
|
1157
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
1158
|
+
* for more details and examples.
|
|
1159
|
+
* @example
|
|
1160
|
+
* ```
|
|
1161
|
+
* const [response] = await client.getLocation(request);
|
|
1162
|
+
* ```
|
|
1163
|
+
*/
|
|
1164
|
+
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
|
|
1165
|
+
/**
|
|
1166
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
|
1167
|
+
*
|
|
1168
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
1169
|
+
* @param {Object} request
|
|
1170
|
+
* The request object that will be sent.
|
|
1171
|
+
* @param {string} request.name
|
|
1172
|
+
* The resource that owns the locations collection, if applicable.
|
|
1173
|
+
* @param {string} request.filter
|
|
1174
|
+
* The standard list filter.
|
|
1175
|
+
* @param {number} request.pageSize
|
|
1176
|
+
* The standard list page size.
|
|
1177
|
+
* @param {string} request.pageToken
|
|
1178
|
+
* The standard list page token.
|
|
1179
|
+
* @param {object} [options]
|
|
1180
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1181
|
+
* @returns {Object}
|
|
1182
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
1183
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
1184
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
|
1185
|
+
* so you can stop the iteration when you don't need more results.
|
|
1186
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1187
|
+
* for more details and examples.
|
|
1188
|
+
* @example
|
|
1189
|
+
* ```
|
|
1190
|
+
* const iterable = client.listLocationsAsync(request);
|
|
1191
|
+
* for await (const response of iterable) {
|
|
1192
|
+
* // process response
|
|
1193
|
+
* }
|
|
1194
|
+
* ```
|
|
1195
|
+
*/
|
|
1196
|
+
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
|
|
1197
|
+
/**
|
|
1198
|
+
* Terminate the gRPC channel and close the client.
|
|
1199
|
+
*
|
|
1200
|
+
* The client will no longer be usable and all future behavior is undefined.
|
|
1201
|
+
* @returns {Promise} A promise that resolves when the client is closed.
|
|
1202
|
+
*/
|
|
1203
|
+
close(): Promise<void>;
|
|
1204
|
+
}
|