mirror of
https://github.com/vale981/grapher
synced 2025-03-05 09:31:42 -05:00
23 lines
388 B
JavaScript
23 lines
388 B
JavaScript
import { Mongo } from 'meteor/mongo';
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
const db = new Proxy(
|
|
{},
|
|
{
|
|
get: function(obj, prop) {
|
|
if (typeof prop === 'symbol') {
|
|
return obj[prop];
|
|
}
|
|
|
|
const collection = Mongo.Collection.get(prop);
|
|
|
|
if (!collection) {
|
|
return obj[prop];
|
|
}
|
|
|
|
return collection;
|
|
},
|
|
}
|
|
);
|
|
|
|
export default db;
|