couchdb

couchdb query a view with key parameters

↘锁芯ラ 提交于 2020-01-02 01:37:51
问题 Without a key parameter, the view works correctly $curl "http://127.0.0.1:5984/music/_design/albums/_view/by_release_date" {"total_rows":311,"offset":0,"rows":[ {"id":"a4327d0718d3b1e227df7124a99a7fc3","key":"1991-12-22","value":{"by":"张楚","title":"黑月亮"}}, {"id":"a4327d0718d3b1e227df7124a99a3ac5","key":"unknown","value":{"by":"郑钧","title":"郑钧:赤裸裸"}}, but when with a key, i got either bad request response or empty result. Why? $curl "http://127.0.0.1:5984/music/_design/albums/_view/by_release

CouchDB vs MongoDB (memory utilization)

孤街醉人 提交于 2020-01-02 01:07:08
问题 Which has the better performance in low memory environments (sub 1GB) ? I've used MongoDB in the past which seems to struggle memory-wise with a database of 250mb on a 512mb box, would the same be true of CouchDB ? 回答1: CouchDB uses very little memory. It has been embedded in iOS and Android more-or-less unmodified—Erlang and all. CouchDB works completely through file i/o, delegating caching to the operating system (filesystem cache). A typical situation on a CouchDB server is to see a very

CouchDB: This database failed to load / No DB shards could be opened (logged in as admin)

廉价感情. 提交于 2020-01-01 19:15:43
问题 I am trying to regain access to my databases stored in CouchDB, but the error This database failed to load. gets shown instead of the databases (see attachments). I started seeing all of these errors at once It be some user rights misconfiguration (1. The error This database failed to load. is normal, when lacking privileges, 2. The actions to delete or replicate a DB are missing). However, I am logged as admin. Can you help me find the root cause of the error? Simple PUT and DELETE requests

CouchDB: This database failed to load / No DB shards could be opened (logged in as admin)

随声附和 提交于 2020-01-01 19:15:13
问题 I am trying to regain access to my databases stored in CouchDB, but the error This database failed to load. gets shown instead of the databases (see attachments). I started seeing all of these errors at once It be some user rights misconfiguration (1. The error This database failed to load. is normal, when lacking privileges, 2. The actions to delete or replicate a DB are missing). However, I am logged as admin. Can you help me find the root cause of the error? Simple PUT and DELETE requests

Why is the CouchDB documentation suggesting docs should not be emitted in the view?

与世无争的帅哥 提交于 2020-01-01 15:01:37
问题 In the View Collation chapter of the CouchDB official documentation under the first example (http://docs.couchdb.org/en/1.6.1/couchapp/views/collation.html#views-collation), it is suggested that it is not recommended to emit the document itself in the view and instead, it is suggested to include the bodies of the documents when requesting the view, by requesting the view with ?include_docs=true . If I understood it correctly, instead of: emit(doc._id, doc); and getting results in the

Chained map/reduce in couchDB

回眸只為那壹抹淺笑 提交于 2020-01-01 11:57:19
问题 In couchDB, I have a set of items like the following (simplified for example's sake): {_id: 1, date: "Jul 1", user: "user1"} {_id: 2, date: "Jul 2", user: "user1"} {_id: 3, date: "Jul 3", user: "user2"} ...etc... I'd like to get a list of "most recent activity", sorted by date, with no duplicate user _ids. I can create a view with results like so: {key: "July 3", _id: 3, user: "user2"} {key: "July 2", _id: 2, user: "user1"} {key: "July 1", _id: 1, user: "user1"} but this contains duplicate

How do I upload an attachment to a document in CouchDB using ibrowse?

好久不见. 提交于 2020-01-01 10:53:07
问题 I have used curl to upload an image file Penguins.jpg . For example: C:\curl>curl -vX PUT -H "Content-Type: image/jpeg" http://localhost:5984/DBNAME/DOCID/Penguins?rev=LATEST_REVISION --data-binary @Penguins.jpg and it worked... So, how can I achieve the same using ibrowse? =============================== 回答1: Naturally, a file upload is an HTTP POST . Now lets first write piece of Erlang code which does HTTP/1.1 POST with Ibrowse . %% Assumes Ibrowse application is in Code path ensure

can we use cassandra / couchdb / mongodb with google app engine infrastructure?

妖精的绣舞 提交于 2020-01-01 09:37:29
问题 Is there anyway we can use Google App Engine but do not use google's bigtable? Like for storing my data, I would prefer to use cassandra and have the ability to plug and unplug additional database servers. And say if I would like to use CouchDb/MongoDb instead is it supported in the GAE's infrastructure? 回答1: Short answer : No. Longer answer : It depends how you want/need to use the database systems. There is no way you could run those system directly on AppEngine. But if low-latency was not

Is there any way to emit attachment data in a couchdb view

心已入冬 提交于 2020-01-01 08:05:35
问题 I have found it very useful to use CouchDB attachments when image displaying data on a website. However when I replicate the database to a mobile environment, it's very inefficient to run a view and then have to cycle through the documents to get access to their attachments. On the iOS/Android platform it seems a lot more efficient to store the data as regular BLOBS and have access to all binary data with just one view query, the view query that emits all the document data in the first place.