Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add how to use couchdb view query options #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@ CouchDB. And this is a way to make a query using predefined views with Python:
[{'value': 1, 'key': 'Fooo'}]


Both type of queries support querying options provided by CouchDB view API
https://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options.
Example of query using key that is used in ``emit()`` function.

.. code-block:: python

>>> map_func = "function(doc) { emit(doc.name, 1); }"
>>> db.temporary_query(map_func)
<generator object _query at 0x7f65bd292870>
>>> list(db.temporary_query(map_func, key='Fooo'))
[{'value': 1, 'id': '8b588fa0a3b74a299c6d958467994b9a', 'key': 'Fooo'}]


Subscribe to a changes stream feed
----------------------------------

Expand Down