Skip to content

Commit

Permalink
Merge pull request #1 from shimaore/patch-1
Browse files Browse the repository at this point in the history
Allow to `remove` a document
  • Loading branch information
logicalparadox committed May 13, 2013
2 parents bfb171b + c6eadad commit b0c92cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/supercouch.js
Expand Up @@ -830,6 +830,7 @@ module.exports = function (agent) {

/**
* ### .remove (id, rev[, callback])
* ### .remove (doc[, callback])
*
* Remove a document from the selected database.
* A revision is required per CouchDB specifications.
Expand All @@ -839,13 +840,18 @@ module.exports = function (agent) {
*
* @param {Mixed} document id
* @param {String} document revision
* @param {Object} document with proper id and revision fields
* @param {Function} optional callback
* @name remove
* @api public
*/

Db.prototype.remove = function (id, rev, fn) {
if (isFn(rev)) fn = rev, rev = null;
if (isObj(id)) {
rev = id._rev;
id = id._id;
}

var opts = merge({
method: 'DELETE'
Expand Down

0 comments on commit b0c92cd

Please sign in to comment.