Skip to content

Commit

Permalink
fix: async_document docs to match expected usecase (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafilong committed Jul 27, 2020
1 parent 1801ba2 commit f26f222
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions google/cloud/firestore_v1/async_document.py
Expand Up @@ -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': {
Expand All @@ -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': {
Expand All @@ -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': {
Expand All @@ -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': {
Expand All @@ -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': {
Expand Down

0 comments on commit f26f222

Please sign in to comment.