问题
Normally you can only delete single records from a local Meteor.Collection
.
回答1:
A simple solution would be:
var clean = function(collection) {
if(collection) {
// clean items
_.each(collection.find().fetch(), function(item){
collection.remove({_id: item._id});
});
}
}
来源:https://stackoverflow.com/questions/17072350/how-can-i-clean-a-local-collection-in-meteor