mirror of
https://github.com/vale981/grapher
synced 2025-03-06 01:51:38 -05:00
21 lines
379 B
JavaScript
21 lines
379 B
JavaScript
import { Mongo } from 'meteor/mongo';
|
|
|
|
const db = new Proxy(
|
|
{},
|
|
{
|
|
get: function(obj, prop) {
|
|
const collection = Mongo.Collection.get(prop);
|
|
|
|
if (!collection) {
|
|
throw new Meteor.Error(
|
|
'collection-not-found',
|
|
`There is no collection with name ${prop}`
|
|
);
|
|
}
|
|
|
|
return collection;
|
|
},
|
|
}
|
|
);
|
|
|
|
export default db;
|