grapher/lib/db.js
2018-03-30 06:42:02 +03:00

20 lines
396 B
JavaScript

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';
const db = new Proxy(
{},
{
get: function(obj, prop) {
const collection = Mongo.Collection.get(prop);
if (!collection) {
Meteor.isDevelopment &&
console.warn(`There is no collection with the name: "${prop}"`);
}
return collection;
},
}
);
export default db;