Skip to content

Commit 7a440c7

Browse files
author
vmatyusGitHub
authored
Add streaming examples as notes to update_doc example file (#102)
1 parent 58f8231 commit 7a440c7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/examples/src/update_doc.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
doc_id=example_doc_id
2222
).get_result()
2323

24+
# Note: for response byte stream use:
25+
# document_as_byte_stream = client.get_document_as_stream(
26+
# db=example_db_name,
27+
# doc_id=example_doc_id
28+
# ).get_result()
29+
2430
# Add Bob Smith's address to the document
2531
document["address"] = "19 Front Street, Darlington, DL5 1TY"
2632

@@ -34,6 +40,12 @@
3440
document=document
3541
).get_result()
3642

43+
# Note: for request byte stream use:
44+
# update_document_response = client.post_document(
45+
# db=example_db_name,
46+
# document=document_as_byte_stream
47+
# ).get_result()
48+
3749
# Keep track with the revision number of the document object:
3850
document["_rev"] = update_document_response["rev"]
3951
print(f'You have updated the document:\n' +
@@ -43,4 +55,4 @@
4355
if ae.code == 404:
4456
print('Cannot delete document because either ' +
4557
f'"{example_db_name}" database or "{example_doc_id}" ' +
46-
'document was not found.')
58+
'document was not found.')

0 commit comments

Comments
 (0)