0

My CouchDB stores documents structured in the following way:

{
  "_id": "1e8903e7b054c5129d3d5b605f000366",
  "_rev": "1-f95adbeff8401059f55494da920e2725",
  "person": "Rachel",
  "age": 36
}

I'm trying to read contents of such documents using the following class method:

import couchdb
import credentials


class CouchDBConnector:
    """Database connector."""

    couch = couchdb.Server(
        f'http://{credentials.COUCHDB_USER}:{credentials.COUCHDB_PASSWORD}'
        + '@localhost:5984/')

    def __init__(self, db_name):
        self.db_name = db_name

    def find_doc_by_name(self):
        map_fun = '''function(doc) {
            emit([doc.person, doc.age], doc.age);
             }'''
        for row in self.couch[self.db_name].query(map_fun):
            print(row)

The query and map_fun are taken directly from couchdb-python documentation. Yet, when trying to call the find_doc_by_name() method:

cdb = CouchDBConnector('testdb')
cdb.find_doc_by_name()

I get the following error:

[...] raise ServerError((status, error))
couchdb.http.ServerError: (410, ('gone', 'Temporary views are not supported in CouchDB'))

Did I miss something while copying the documentation examples? Or has something changed recently and the docs weren't updated yet?

Apache CouchDB 3.2.2 is in use here.

AbreQueVoy
  • 1,748
  • 8
  • 31
  • 52
  • Does this answer your question? [Temporary views are not supported in CouchDB](https://stackoverflow.com/questions/47969233/temporary-views-are-not-supported-in-couchdb) – RamblinRose Nov 10 '22 at 13:41

0 Answers0