I'm happy to announce the release of totally rewritten jqCouch -library. Major changes were made so this version is no longer compatible with the older release. Talking with CouchDB is now done through 3 type of connections.
db -connection:
This is used to handle all those Database related tasks such as creating and deleting.
Available methods:
- exists
- info
- create
- del
- all
- restart
This is used to handle all those Document related tasks. Creating, Updating, Deleting documents.
Available methods:
- get
- all
- save
- bulk_save
- del
- (post)
- (put)
This handles all actions related to Views.
Available methods:
- exists
- info
- get
- save
- del
- temp
- (put)
Some basic usage examples:
creating connections:
//Database connection
var dbc = $.jqCouch.connection('db');
//Document connection with custom config
var dc = $.jqCouch.connection('doc', {cache:true});
//View connection with connection specific mapping function
var vc = $.jqCouch.connection('view', function(data){return data;});
//Database connection with connection specific mapping function and custom settings
var dbc = $.jqCouch.connection('db', function(data){return data;}, {cache:true});
Setting global configurations:
$.jqCouch.set_defaults({
cache: true
});
Creating new document (One liner):
var revision = $.jqCouch.connection('doc').save('doc_db', {id: "0", title: 'test'})._rev;
More info can be found from the source of the library and the testsuite included in the release
This library is part of the Ajatus - Distributed CRM
For some reason the jQuery website is not working properly and it seem that it has reverted to some old backup as the release no longer exists there. Here is a local link to the release: jqcouch-2.0.1.zip
