couchdb python query document from view

1.2k views Asked by At

Based on existing question Multiple CouchDB Document fetch with couchdb-python

The question was:

Blockquote: How to fetch multiple documents from CouchDB, in particular with couchdb-python?

One answer was:

Blockquote: Easiest way is to pass a include_docs=True arg to Database.view. Each row of the results will include the doc

My question: how can i 'cast' or convert the returned document to my custom defined document.

Thanks

1

There are 1 answers

0
Stefan Kögl On

As you're using Python I'd recommend couchdbkit. There you can either use the MyDocument.view() method or pass a schema parameter to Database.view().