daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. couch.get({
  2.   url: '/someDoc',
  3.   callback: function(resp, success) {
  4.     if(!success) {
  5.       console.log('it\'s already gone');
  6.     }
  7.     else {
  8.       couch.delete(resp.body._id, resp.body._rev, function(resp, success) {
  9.         if(success) {
  10.           console.log('deleted!');
  11.         }
  12.         else if(resp._HTTP.status == 404) {
  13.           console.log('someone deleted it before we could');
  14.         }
  15.         else {
  16.           console.log('issue deleting: HTTP ' + resp._HTTP.status);
  17.         }
  18.       });
  19.     }
  20.   }
  21. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top