Comparing version 0.1.8 to 0.1.9
44
index.js
@@ -145,23 +145,2 @@ var mongo = require('mongodb'); | ||
}; | ||
Collection.prototype.count = function() { | ||
this._exec('count', arguments); | ||
}; | ||
Collection.prototype.remove = function() { | ||
this._exec('remove', arguments); | ||
}; | ||
Collection.prototype.update = function() { | ||
this._exec('update', arguments); | ||
}; | ||
Collection.prototype.rename = function() { | ||
this._exec('rename', arguments); | ||
}; | ||
Collection.prototype.save = function() { | ||
this._exec('save', arguments); | ||
}; | ||
Collection.prototype.insert = function() { | ||
this._exec('insert', arguments); | ||
}; | ||
Collection.prototype.insertAll = function() { | ||
this._exec('insertAll', arguments); | ||
}; | ||
Collection.prototype.findAndModify = function(options, callback) { | ||
@@ -191,2 +170,10 @@ this._exec('findAndModify', [options.query, options.sort || [], options.update || {}, { | ||
Object.keys(mongo.Collection.prototype).forEach(function(name) { | ||
if (!Collection.prototype[name] && typeof mongo.Collection.prototype[name] === 'function') { | ||
Collection.prototype[name] = function() { | ||
this._exec(name, arguments); | ||
}; | ||
} | ||
}); | ||
exports.connect = function(url, collections) { | ||
@@ -255,2 +242,15 @@ url = parse(url); | ||
}; | ||
Object.keys(mongo.Db.prototype).forEach(function(name) { | ||
if (!that[name] && typeof mongo.Db.prototype[name] === 'function') { | ||
that[name] = function() { | ||
var args = arguments; | ||
var callback = args[args.length-1]; | ||
ondb.get(common.fork(callback, function(db) { | ||
db[name].apply(db, args); | ||
})); | ||
}; | ||
} | ||
}); | ||
@@ -274,2 +274,2 @@ if (collections) { | ||
return that; | ||
}; | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["mongo", "db", "mongodb"], | ||
"version":"0.1.8", | ||
"version":"0.1.9", | ||
"homepage" : "https://github.com/gett/mongojs", | ||
@@ -8,0 +8,0 @@ "author": "Ge.tt <hello@ge.tt>", |
@@ -5,3 +5,3 @@ # mongojs | ||
npm install mongojs | ||
npm install mongojs --mongodb:native | ||
@@ -8,0 +8,0 @@ mongojs is very simple to use: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8534
234