Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add example for Precondition #601

Merged
merged 1 commit into from Apr 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions dev/src/index.ts
Expand Up @@ -133,6 +133,16 @@ const GRPC_UNAVAILABLE = 14;
* can be restricted to only apply to documents that match the specified
* conditions.
*
* @example
* const documentRef = firestore.doc('coll/doc');
*
* documentRef.get().then(snapshot => {
* const updateTime = snapshot.updateTime;
*
* console.log(`Deleting document at update time: ${updateTime.toDate()}`);
* return documentRef.delete({ lastUpdateTime: updateTime });
* });
*
* @property {string} lastUpdateTime The update time to enforce (specified as
* an ISO 8601 string).
* @typedef {Object} Precondition
Expand Down