CouchDB a real world example

The upcoming book by O’Reilly is free to read online: http://books.couchdb.org/relax/ Just install and play around – you can do straight http requests using curl on the command line, or use the built-in web interface called futon. Storing and retrieving data is really easy, the hardest part is thinking in terms of map/reduce-views instead of … Read more

Dealing with conflicts caused by replication in BigCouch

Get the revision number of the document to be updated if there is a conflict during attachment and recursively call in-case of a conflict, $url = “http://couchdb/DATABASE/DOCID/ATTACHMENTNAME?rev=$rev”; curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_PUT, true ); curl_setopt( $ch, CURLOPT_URL, $url ); curl_exec( $ch );

Creating regular users in CouchDB

First you put the user in _users database. The ID of the document must be org.couchdb.user:username, e.g. With CouchDB 1.2.0 or later use this: { “_id”: “org.couchdb.user:dbreader”, “name”: “dbreader”, “type”: “user”, “roles”: [], “password”: “plaintext_password” } CouchDB will hash & salt the password for you on the server side and save the values in the … Read more