Skip to content

Commit

Permalink
Fix runCommand() bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorribas committed Aug 31, 2013
1 parent b35dd5a commit 66ae6a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ Collection.prototype.getIndexes = function() {

Collection.prototype.runCommand = function(cmd, opts, callback) {
callback = callback || noop;
if (callback === noop && typeof opts === 'function') {
opts = opts || {};
if (typeof opts === 'function') {
callback = opts;
};
this._get(function(err, collection) {
Expand Down

0 comments on commit 66ae6a1

Please sign in to comment.