Permalink
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 327 Bytes

Deleting Data

Records can be deleted from Model-level.

// ./index.js
var Posts = require('./collections/Posts');
var posts = new posts();

var post = posts.model({id: 1});

post.delete()
  .then(function () {
    // successfully deleted
  })
  .catch(function () {
    // couldn't delete, an error occurred
  });