python - bulk retrieve in CouchDB? -


I recently started thinking about CouchDB to store a large list of manipulative dikts manipulation in Python is. In my case, about 20 elements of the big means.

I found that this method is very quick to push my entire list into an HTTP call. It takes about 3 seconds, which is perfect for my case.

I also need to get the full contents of this database and store it in the list of dicts (in a separate script). Unfortunately, this is an upside operation. Unfortunately, I have found the only way to do this

  # db A cache. The database is opened after the server () call mylist = list () in db for the id: mylist.append (db [id])  

This takes 10 minutes because each of the loops Call for element.

  • What is the equivalent of update
  • Should I contact the retrieval part in a different, more efficient way?

    The easiest way to get each document is by _all_docs To issue a request for and pass include_docs = true .

    _all_docs will get the original details (_id, modification) of all documents in the database. The cause of the complete documents to be included in the include_docs response.

      / mydatabase / _all_docs? Include_docs = true  

    If you need a bit more subtle (like returning a scalar value for each document) than returning the entire documents, then you need to check it out .


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Algorithm negotiation fail SSH in Jenkins -

java - Messages from .properties file do not display UTF-8 characters -