8000 fix(firestore): Add await to the example (#10956) · peterma/gcp-python-docs-samples@7c65be4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c65be4

Browse 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

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

firestore/cloud-async-client/snippets.py

Lines 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

Lines 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