From 2f413514957ff7498d00b4e41a6ccfc4bbdcf6cc Mon Sep 17 00:00:00 2001 From: Rafi Long Date: Fri, 24 Jul 2020 13:50:43 -0500 Subject: [PATCH] fix: async_document docs to match expected usecase --- google/cloud/firestore_v1/async_document.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/google/cloud/firestore_v1/async_document.py b/google/cloud/firestore_v1/async_document.py index a2e54492e..0b7c3bfd3 100644 --- a/google/cloud/firestore_v1/async_document.py +++ b/google/cloud/firestore_v1/async_document.py @@ -120,7 +120,7 @@ async def update(self, field_updates, option=None): .. code-block:: python - >>> snapshot = document.get() + >>> snapshot = await document.get() >>> snapshot.to_dict() { 'foo': { @@ -138,14 +138,14 @@ async def update(self, field_updates, option=None): ... 'quux': 800, ... }, ... } - >>> document.update(field_updates) + >>> await document.update(field_updates) then all of ``foo`` will be overwritten on the server and the new value will be .. code-block:: python - >>> snapshot = document.get() + >>> snapshot = await document.get() >>> snapshot.to_dict() { 'foo': { @@ -162,14 +162,14 @@ async def update(self, field_updates, option=None): >>> field_updates = { ... 'foo.quux': 800, ... } - >>> document.update(field_updates) + >>> await document.update(field_updates) then only ``foo.quux`` will be updated on the server and the field ``foo.bar`` will remain intact: .. code-block:: python - >>> snapshot = document.get() + >>> snapshot = await document.get() >>> snapshot.to_dict() { 'foo': { @@ -193,13 +193,13 @@ async def update(self, field_updates, option=None): >>> field_updates = { ... 'other': firestore.DELETE_FIELD, ... } - >>> document.update(field_updates) + >>> await document.update(field_updates) would update the value on the server to: .. code-block:: python - >>> snapshot = document.get() + >>> snapshot = await document.get() >>> snapshot.to_dict() { 'foo': { @@ -218,13 +218,13 @@ async def update(self, field_updates, option=None): >>> field_updates = { ... 'foo.now': firestore.SERVER_TIMESTAMP, ... } - >>> document.update(field_updates) + >>> await document.update(field_updates) would update the value on the server to: .. code-block:: python - >>> snapshot = document.get() + >>> snapshot = await document.get() >>> snapshot.to_dict() { 'foo': {