ohif-viewer/LesionTracker/server/dropAllCollections.js
Erik Ziegler ab4d4c9008 Work on refactoring measurements out of Lesion Tracker package
- Removed AssociatedStudies Collection
- Measurement API is generated from configuration files
- Data exchange methods are defined in configuration
2016-11-15 08:21:46 +01:00

15 lines
581 B
JavaScript

// Temporary fix to drop all Collections on server restart
// http://stackoverflow.com/questions/23891631/meteor-how-can-i-drop-all-mongo-collections-and-clear-all-data-on-startup
Meteor.startup(() => {
console.warn('Dropping all Collections!');
Object.keys(global).forEach((key) => {
const object = global[key];
if (object instanceof Meteor.Collection) {
if (!(/^server|currentServer$/).test(object._name)) {
console.warn(`Dropping: ${object._debugName}`);
object.remove({});
}
}
});
});