clearNotifications(options, callback) { this.db.remove({}, {multi: true}, err => { if (err) { callback(null, err); return; } this.count = Object.assign({}, INITIAL_COUNT_VALUE); callback(); }); this.emitUpdate(); }
removeUser(username, callback) { this.db.findOne({username}).exec((findError, user) => { if (findError) { return callback(null, findError); } // Username not found. if (user == null) { return callback(null, user); } this.db.remove({username}, {}, removeError => { if (removeError) { return callback(null, removeError); } fs.removeSync(path.join(config.dbPath, user._id)); return callback({username}); }); }); }
removeItem(id, callback) { let indexToRemove = -1; const itemToRemove = this.feeds.find((feed, index) => { if (feed.options._id === id) { indexToRemove = index; return true; } return false; }); if (itemToRemove != null) { itemToRemove.stopReader(); this.feeds.splice(indexToRemove, 1); } this.db.remove({_id: id}, {}, (err, docs) => { if (err) { callback(null, err); return; } callback(docs); }); }
app.delete( "/customer/:customerId", function ( req, res ) { customerDB.remove( { _id: req.params.customerId }, function ( err, numRemoved ) { if ( err ) res.status( 500 ).send( err ); else res.sendStatus( 200 ); } ); } );
db.remove(obj, {multi: true}, (err, num) => { if (err) { j(err); return; } r(num); });
Swal.fire({ title: 'You are about to delete!', text: "Do you want to delete this customer?", icon: 'warning', showCancelButton: true, confirmButtonColor: '#d33', cancelButtonColor: '#3085d6', confirmButtonText: 'Delete' }).then((result) => { if (result.value) { customerDB.remove( { _id: parseInt(id) }, function ( err, numRemoved ) { getCustomers(); }); } });
app.delete( "/product/:productId", function ( req, res ) { inventoryDB.remove( { _id: parseInt(req.params.productId) }, function ( err, numRemoved ) { if ( err ) res.status( 500 ).send( err ); else res.sendStatus( 200 ); } ); } );
app.post( "/delete", function ( req, res ) { let transaction = req.body; transactionsDB.remove( { _id: transaction.orderId }, function ( err, numRemoved ) { if ( err ) res.status( 500 ).send( err ); else res.sendStatus( 200 ); } ); } );
function remove (id, cb) { db.remove({ _id: id }, (err, removed) => { if (err) return cb(err) cb(null, removed) }) }
routeId.delete((req, res) =>{ db.remove({_id:req.params.id}, {}, err=>{ if (err) { app.utils.error.send(err, req, res); } else { res.status(200).json(req.params); } }); })
remove(path, callback) { db.remove({ path: path }, {}, function (err, numRemoved) { callback(); }); }
Swal.fire({ title: 'You are about to delete!', text: "Do you want to delete this item?", icon: 'warning', showCancelButton: true, confirmButtonColor: '#d33', cancelButtonColor: '#3085d6', confirmButtonText: 'Delete' }).then((result) => { if (result.value) { productDB.remove( { _id: parseInt(id) }, function ( err, numRemoved ) { getProducts(); }); } });
_remove(path) { db.remove({ path: path }, {}, (err, numRemoved) => { }); }
app.delete( "/category/:categoryId", function ( req, res ) { categoryDB.remove( { _id: parseInt(req.params.categoryId) }, function ( err, numRemoved ) { if ( err ) res.status( 500 ).send( err ); else res.sendStatus( 200 ); } ); } );
app.delete( "/user/:userId", function ( req, res ) { usersDB.remove( { _id: parseInt(req.params.userId) }, function ( err, numRemoved ) { if ( err ) res.status( 500 ).send( err ); else res.sendStatus( 200 ); } ); } );