Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

jqCouch - CouchDB connection plugin 2.0.1


Download: jqcouch-2.0.1_0.zip
Size: 32.49 KB
md5_file hash: 67e113d82e531b079180e8f5bd5549a8
First released: December 4, 2007 - 2:22pm

This release is completly rewritten and doesn't work with the previous release.
jqCouch uses now connections to handle different tasks. It also support inner caching of results.

Examples can be found inside the source file and the testsuite included in the package.

Here are some basic tasks:


Database

var dbc = $.jqCouch.connection('db');
dbc.exists('database_name');

---
if ($.jqCouch.connection('db').create('database_name').ok) {
    alert("database created");
}


Doc

var dc = $.jqCouch.connection('doc');
var rev = dc.get('database/document1')._rev;

---
var doc = {_id:"0",a:1,b:1};
if ($.jqCouch.connection('doc').save('database_name', doc)._id !== false) {
    alert("Created document with rev: "+doc._rev+", a="+doc.a);
}

---
//Get all documents from database. (With cache)
var dc = $.jqCouch.connection('doc');
dc.update_config('cache', true);
if (var total_documents = dc.all('database_name').total_rows) {
    var all_documents = dc.all('database_name').rows;   
}
//Get all documents from database. (Without cache)
var dc = $.jqCouch.connection('doc');
var all = dc.all('database_name');
if (all.total_rows > 0) {
    var all_documents = all.rows;   
}


View

var vc = $.jqCouch.connection('view');
if (vc.exists('database_name', 'event') !== false) {
    alert("View "event" exists");
}

---
if ($.jqCouch.connection('view').exists('database_name', 'event/all') !== false) {
    alert("View "event/all" exists");
}


More info: http://protoblogr.net/blog/view/new_release_of_the_jqcouch_library.html

This library is part of the Ajatus - Distributed CRM http://www.ajatus.info