PWV-1: Preventing dropping on Servers and CustomServers Mongo Collections

This commit is contained in:
Bruno Alves de Faria 2016-09-30 18:49:00 -03:00 committed by Erik Ziegler
parent 3c363050f6
commit 481bf30a14

View File

@ -5,8 +5,10 @@ Meteor.startup(function() {
for (var property in global) {
var object = global[property];
if (object instanceof Meteor.Collection) {
console.warn('Dropping: ' + object._debugName);
object.remove({});
if (!(/^server|currentServer$/).test(object._name)) {
console.warn('Dropping: ' + object._debugName);
object.remove({});
}
}
}
});
});