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 7c65be4

Browse filesBrowse files
OsteoporosisOsteoporosis
andauthored
fix(firestore): Add await to the example (GoogleCloudPlatform#10956)
* Firestore - Add await * Firestore - Add argument --------- Co-authored-by: Osteoporosis <tellmewhy@gmail.com>
1 parent 34d9e61 commit 7c65be4
Copy full SHA for 7c65be4

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+6
-1
lines changed

‎firestore/cloud-async-client/snippets.py

Copy file name to clipboardExpand all lines: firestore/cloud-async-client/snippets.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ async def update_document_increment(db):
788788
# [START firestore_data_set_numeric_increment_async]
789789
washington_ref = db.collection("cities").document("DC")
790790

791-
washington_ref.update({"population": firestore.Increment(50)})
791+
await washington_ref.update({"population": firestore.Increment(50)})
792792
# [END firestore_data_set_numeric_increment_async]
793793

794794

‎firestore/cloud-async-client/snippets_test.py

Copy file name to clipboardExpand all lines: firestore/cloud-async-client/snippets_test.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,5 +305,10 @@ async def test_collection_group_query(db):
305305
}
306306

307307

308+
async def test_update_document_increment(db):
309+
await db.collection("cities").document("DC").set({"population": 1})
310+
await snippets.update_document_increment(db)
311+
312+
308313
async def test_list_document_subcollections():
309314
await snippets.list_document_subcollections()

0 commit comments

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