This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ # Unreleased
2+
3+ - [ IMPROVED] Updated ` Getting started ` section with a ` get_query_result ` example.
4+
15# 2.11.0 (2019-01-21)
26
37- [ NEW] Added option for client to authenticate with IAM token server.
Original file line number Diff line number Diff line change @@ -372,6 +372,26 @@ object already exists.
372372 for result in result_collection:
373373 print (result)
374374
375+ This example retrieves the query result from the specified database based on the query parameters provided, updates the
376+ document, and saves the document in the remote database.
377+ By default, the result is returned as a ``QueryResult `` which uses the skip and limit query parameters internally to
378+ handle slicing and iteration through the query result collection. For more detail on slicing and iteration, refer
379+ to the :class: `~cloudant.result.QueryResult ` documentation.
380+
381+ .. code-block :: python
382+
383+ # Retrieve documents where the name field is 'foo'
384+ selector = {' name' : {' $eq' : ' foo' }}
385+ docs = my_database.get_query_result(selector)
386+ for doc in docs:
387+ # Create Document object from dict
388+ updated_doc = Document(my_database, doc[' _id' ])
389+ updated_doc.update(doc)
390+ # Update document field
391+ updated_doc[' name' ] = ' new_name'
392+ # Save document
393+ updated_doc.save()
394+
375395****************
376396Context managers
377397****************
Original file line number Diff line number Diff line change 11mock==1.3.0
22nose
33sphinx
4+ sphinx_rtd_theme
45pylint
56flaky
You can’t perform that action at this time.
0 commit comments