Skip to content

Instantly share code, notes, and snippets.

@chewbranca
Forked from AndrewHenderson/saveDoc.js
Last active December 10, 2015 10:48
Show Gist options
  • Save chewbranca/4422959 to your computer and use it in GitHub Desktop.
Save chewbranca/4422959 to your computer and use it in GitHub Desktop.
$.couch.urlPrefix = "https://username:password@username.cloudant.com";
var db = $.couch.db('crud');
var doc = {"_id":"foo", "name": "bar"};
db.saveDoc(doc, {
success: function(response, textStatus, jqXHR){
console.log(response);
},
error: function(jqXHR, textStatus, errorThrown){
console.log(errorThrown);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment