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

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:24:01 +01:00
1 parent 3c363050f6
commit 481bf30a14
1 file changed
+5 -3
@@ -5,8 +5,10 @@ Meteor.startup(function() {
for (var property in global) { for (var property in global) {
var object = global[property]; var object = global[property];
if (object instanceof Meteor.Collection) { if (object instanceof Meteor.Collection) {
console.warn('Dropping: ' + object._debugName); if (!(/^server|currentServer$/).test(object._name)) {
object.remove({}); console.warn('Dropping: ' + object._debugName);
object.remove({});
}
} }
} }
}); });