Skip to content
dr.dimitru edited this page Apr 8, 2016 · 9 revisions
remove(selector) [Isomorphic]

Remove records from collection and files from FS.

  • selector {Object} - See Mongo Selectors
  • Returns {Files} - Current Meteor.Files instance
var Images = new Meteor.Files({collectionName: 'Images'});

// Usage:
// Drop collection's data and remove all associated files from FS
Images.remove({});
// Remove particular file
Images.remove({_id: 'Rfy2HLutYK4XWkwhm'});
// Equals to above
Images.findOne({_id: 'Rfy2HLutYK4XWkwhm'}).remove();


// Direct Collection usage
// Remove record(s) from collection
Images.collection.remove({})
Clone this wiki locally