Questions tagged [couchdb-python]

couchdb-python is a Python library for interfacing with the document-oriented, CouchDB NoSQL database.

couchdb-python consists of four main modules:

  1. couchdb.client, which contains code for interfacing with the CouchDB server
  2. couchdb.design, which enables creation and modification of design documents
  3. couchdb.mapping, a helper module that maps between CouchDB and Python objects and
  4. couchdb.view, a view server that allows one to write view functions in Python rather than the standard JavaScript.

You can find more information from the couchdb-python website or browse the documentation.

79 questions
1
vote
2 answers

How to display a couchdb image attachment in a Django template

I am using couchdb-python with Django. I am looking for a way to display an image (which is stored in the database as an attachment to a document) in a template. Oddly, I cannot find any example online of how to do this. Currently, in the views.py…
rossdavidh
  • 1,966
  • 2
  • 22
  • 33
1
vote
3 answers

Meaning of the map function in couchdb-pythons ViewField

I'm using the couchdb.mapping in one of my projects. I have a class called SupportCase derived from Document that contains all the fields I want. My database (called admin) contains multiple document types. I have a type field in all the documents…
Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169
1
vote
1 answer

Work with nested objects using couchdb-python

Disclaimer: Both Python and CouchDB are new for me. So far my "programming" has mostly consisted of Bash scripts. I'm trying to create a small script that updates objects in a CouchDB database. The objects however aren't created by my script but by…
1
vote
1 answer

Bulk Undelete CouchDB Docs with CouchDB-Python

I accidentally deleted all the docs in a CouchDB database and I want to undelete them. CouchDB version = 2.2.0 Python = 2.7 and I'm using the python-couchDB library. My CouchDB is not doing any compaction and 1260 documents are listed in the…
CMant
  • 31
  • 5
1
vote
1 answer

How to query for negated results in CouchDB (Python)

Does CouchDB have a way to return back the documents that do not meet a certain filter criteria? I am using Python' API and provided an example below: couch['test_db'].view('doc/entrybyname', key=value, include_docs=True) Say I wanted all the…
Brian
  • 421
  • 3
  • 20
1
vote
0 answers

python3 how to install couchdb module on raspbian

I have spent a couple of months developing an application that uses the python module for couchdb, and now I want to deploy it, I can't remember how I first installed it, I thought it was a simple: sudo apt-get install couchdb-python but I seem to…
iFunction
  • 1,208
  • 5
  • 21
  • 35
1
vote
1 answer

How to get filtered changes in python couchdb

I'm using python-couchdb library to listen to the changes in database using continuous feed. I want to apply a filter which gives me only those documents that have a key read equal to true. With normal HTTP GET request, I get the desired results.…
Sanyam Khurana
  • 1,336
  • 1
  • 14
  • 27
1
vote
1 answer

Python with CouchDB 2.0

I have CouchDB 2.0 server. I need to create, delete, get, update and query the databases via python. On 1.6 version there was a couchdb-python lib. What is the best option here ? Work with the couchdb rest-api directly?
Oz Bar-Shalom
  • 1,747
  • 1
  • 18
  • 33
1
vote
0 answers

CouchDB view query fails when a complex JSON is used as a key

I have created a view on the db which emits key,value pair like so: emit([doc.some_key, doc.inner_doc], doc) Note that doc.inner_doc can be just any other JSON document. Now, there is a problem while fetching records for such keys. Whenever the…
ham
  • 716
  • 5
  • 12
1
vote
1 answer

Fetching data from a view written in CouchDB-Futon using Python

I have a database with around 2 million documents. This database contains a lot of duplicate documents. I wrote a map reduce function in CouchDB-Futon, which removes the duplicates. Now I want to get the values of this view in my python script.…
user4563977
1
vote
1 answer

Flask-Paginate with CouchDB

I found here a nice template for a pagination. However, this example was done with SQLlite, but I rewrote in order to be able to use CouchDB. This script creates users and save them to CouchDB: from couchdb import Server import sys def…
user977828
  • 7,259
  • 16
  • 66
  • 117
1
vote
1 answer

How to use couchdb-python to call a view with a list of keys?

I have this ViewDefinition: """ Models id.""" models = ViewDefinition('models', 'by_authors', """ function(doc) { if (doc.type == "definition") { for (var i = 0; i < doc.authors.length; i++) { var author = doc.authors[i]; …
Natim
  • 17,274
  • 23
  • 92
  • 150
1
vote
1 answer

Error while installing couch DB version 1.5.1

While installing couch DB 1.5.1 from source, in the step where make is called I get this error make[1]: *** No rule to make target `THANKS', needed by `THANKS.gz'. Stop. make[1]: Leaving directory `/somedir' make: *** [install-recursive] Error…
Abbyss
  • 155
  • 1
  • 9
1
vote
1 answer

Python, CouchDb: how to Update already existing document by ID

I am trying to update an already existing document by ID. My intention is to find the doc by its id, then change its "firstName" with new value coming in "json", then update it into the CouchDB database. Here is my code: def updateDoc(self, id,…
Amit
  • 451
  • 2
  • 6
  • 19
1
vote
1 answer

How to change permissions on a couchdb database with python

I am trying to add a user in the "_security" document of a database with python-couchdb. I am getting an error because the "_security" document doesn't have an "_id" attribute. import…
vkefallinos
  • 717
  • 1
  • 9
  • 24