Skip to content

Commit

Permalink
Add support for Cursor.explain()
Browse files Browse the repository at this point in the history
  • Loading branch information
sorribas committed Aug 4, 2013
1 parent 942cf51 commit abb435e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ Cursor.prototype.count = function() {
this._apply(DRIVER_CURSOR_PROTO.count, arguments);
};

Cursor.prototype.explain = function() {
this._apply(DRIVER_CURSOR_PROTO.explain, arguments);
};

Cursor.prototype.limit = function() {
return this._config(DRIVER_CURSOR_PROTO.limit, arguments);
};
Expand All @@ -76,6 +80,10 @@ Cursor.prototype.destroy = function() {
this.push(null);
};

Cursor.prototype.explain = function() {
return this._apply(DRIVER_CURSOR_PROTO.explain, arguments);
};

Cursor.prototype._apply = function(fn, args) {
this._get(function(err, cursor) {
if (err) return getCallback(args)(err);
Expand Down

0 comments on commit abb435e

Please sign in to comment.