Browse Source

added proxy support

saintedlama/travis-non-legacy
Mathias Buus 14 years ago
parent
commit
075c2cb56d
  1. 11
      index.js
  2. 4
      package.json

11
index.js

@ -251,5 +251,16 @@ exports.connect = function(url, collections) {
that[col] = that.collection(col);
});
if (typeof Proxy !== undefined) {
return Proxy.create({
get: function(proxy, name) {
if (!that[name]) {
that[name] = that.collection(name);
}
return that[name];
}
});
}
return that;
};

4
package.json

@ -1,11 +1,11 @@
{
"name":"mongojs",
"description":"a simple mongo module that emulates the mongo api",
"version":"0.1.0",
"version":"0.1.1",
"author": "Ge.tt <hello@ge.tt>",
"contributors": [
"Mathias Buus Madsen <m@ge.tt>"
]
],
"main":"./index.js",
"dependencies": {"common":">=0.1.0", "mongodb":">=0.8.0"}
}

Loading…
Cancel
Save