Browse Source

Implement command execution on collection level

saintedlama/travis-non-legacy
saintedlama 9 years ago
parent
commit
749dfd76cf
  1. 7
      lib/database.js

7
lib/database.js

@ -74,12 +74,11 @@ Database.prototype.runCommand = function (opts, cb) {
opts[tmp] = 1
}
var self = this
this._getConnection(function (err, server) {
this._getConnection(function (err, connection) {
if (err) return cb(err)
server.command(self._dbname + '.$cmd', opts, function (err, result) {
connection.command(opts, function (err, result) {
if (err) return cb(err)
cb(null, result.result)
cb(null, result)
})
})
}

Loading…
Cancel
Save