CleverStack/clever-odm

View on GitHub
lib/model/instance/destroy.js

Summary

Maintainability
A
1 hr
Test Coverage
var util       = require('util')
  , utils      = require('utils')
  , inspect    = utils.helpers.debugInspect;

module.exports = function destroyModel(queryOptions, callback) {
  if (this.debug.enabled) {
    this.debug(util.format('odmUtils.destroy(%s)', inspect(Object.keys(queryOptions).join(', '))));
  }
  
  this
    .entity
    .remove(queryOptions)
    .then(callback.bind(null, null))
    .catch(callback);
};