Skip to content

Instantly share code, notes, and snippets.

@pegli
Created August 29, 2012 23:10
Show Gist options
  • Save pegli/3520111 to your computer and use it in GitHub Desktop.
Save pegli/3520111 to your computer and use it in GitHub Desktop.
TiTouchDB save new document
var server = require('com.obscure.titouchdb'),
db = server.databaseNamed('mydb');
var doc = db.untitledDocument()
var result = doc.putProperties({
foo: 10,
bar: 'a string',
x: [1,2,3,4]
});
if (result.error) {
// handle error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment