Skip to content

Commit

Permalink
docs: Add example for Precondition (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Apr 16, 2019
1 parent dac6246 commit 89afaeb
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 89afaeb

Please sign in to comment.