Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ce1495

Browse filesBrowse files
authored
Add fs_update_document_increment snippet (GoogleCloudPlatform#2341)
* bump google-cloud-firestore to v1.4.0
1 parent 9226981 commit 0ce1495
Copy full SHA for 0ce1495

File tree

Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-firestore==1.1.0
1+
google-cloud-firestore==1.4.0

‎firestore/cloud-client/snippets.py

Copy file name to clipboardExpand all lines: firestore/cloud-client/snippets.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,3 +875,11 @@ def collection_group_query(db):
875875
print(u'{} => {}'.format(doc.id, doc.to_dict()))
876876
# [END fs_collection_group_query]
877877
return docs
878+
879+
880+
def update_document_increment(db):
881+
# [START fs_update_document_increment]
882+
washington_ref = db.collection(u'cities').document(u'DC')
883+
884+
washington_ref.update("population", firestore.Increment(50))
885+
# [END fs_update_document_increment]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.