[Helma-user] CouchDB beginnings

Joshua Paine joshua at papercrown.org
Sun Dec 9 07:28:57 CET 2007


FYI, I've ported the basic CouchDB javascript lib that comes with 
CouchDB from browser XMLHttpRequest, etc. to helma.Http. In so doing I 
had to work through a bug in helma.Http, so if you want to use this 
you'll need to make the changes to your local modules/helma/Http.js that 
I suggest in:

<http://helma.org/bugs/show_bug.cgi?id=583>

And then get the CouchDB lib from:

<http://helma.pastebin.com/f7082c07e>

Once you have patched Http.js and included CouchDB.js, you can do easy 
stuff like this:

var c = new CouchDB('testing','localhost',8888);
c.createDb();
c.save({ title:'Testing', content:[1,2,3] });

Congrats! You just created a DB and saved a document in it.

See 
<http://jan.prima.de/~jan/plok/archives/108-Programming-CouchDB-with-Javascript.html> 
for a sample client-side app and the docs at 
<http://www.couchdbwiki.com/index.php?title=HTTP_REST_API>.

-Joshua


More information about the Helma-user mailing list