Skip to content

Instantly share code, notes, and snippets.

@pegli
Created August 29, 2012 23:25
Show Gist options
  • Save pegli/3520302 to your computer and use it in GitHub Desktop.
Save pegli/3520302 to your computer and use it in GitHub Desktop.
using couch_client.js
var client = require('couch_client').CouchClient('http://foo.iriscouch.com');
var db = client.database('mydb');
db.create(); // if not already created
var document = {
x: 10,
y: 'some string',
foo: [1, 2, 3]
};
db.save(document, function(response, status)) {
Ti.API.info(JSON.stringify(response));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment