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 passinclude_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 theinclude_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 .
- Should I contact the retrieval part in a different, more efficient way?
Comments
Post a Comment