summaryrefslogtreecommitdiff
path: root/src/mongo/shell/query.js
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2015-09-15 17:20:23 -0400
committerJonathan Reams <jbreams@mongodb.com>2015-09-15 17:20:53 -0400
commitbded2a3deda7dd1152d69b3c5892b59eea7d7ff2 (patch)
tree86a4fb5699dc370598885e934831860d44a4bbab /src/mongo/shell/query.js
parent7f12a49a2c78b94e5414d060ddcdda0cc7b39dd2 (diff)
downloadmongo-bded2a3deda7dd1152d69b3c5892b59eea7d7ff2.tar.gz
Revert "SERVER-17792 Kill cursors when query limit is reached in the shell"
This reverts commit aaa8ea34945e4d4330a2d71c69c81f51824cf251.
Diffstat (limited to 'src/mongo/shell/query.js')
-rw-r--r--src/mongo/shell/query.js20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/mongo/shell/query.js b/src/mongo/shell/query.js
index 668d3a5c1b5..e9317052163 100644
--- a/src/mongo/shell/query.js
+++ b/src/mongo/shell/query.js
@@ -51,7 +51,6 @@ DBQuery.prototype.help = function () {
print("\t.map( func )")
print("\t.hasNext()")
print("\t.next()")
- print("\t.kill()")
print("\t.objsLeftInBatch() - returns count of docs left in current batch (when exhausted, a new getMore will be issued)")
print("\t.itcount() - iterates through documents and counts them")
print("\t.getQueryPlan() - get query plans associated with shape. To get more info on query plans, " +
@@ -256,10 +255,8 @@ DBQuery.prototype.skip = function( skip ){
DBQuery.prototype.hasNext = function(){
this._exec();
- if ( this._limit > 0 && this._cursorSeen >= this._limit ) {
- this._cursor.kill();
+ if ( this._limit > 0 && this._cursorSeen >= this._limit )
return false;
- }
var o = this._cursor.hasNext();
return o;
}
@@ -668,21 +665,6 @@ function DBCommandCursor(mongo, cmdResult, batchSize) {
DBCommandCursor.prototype = {};
-DBCommandCursor.prototype.kill = function() {
- if (!this._useReadCommands) {
- this._cursor.kill();
- } else {
- var killCursorCmd = {
- killCursors: this._collName,
- cursors: [ this._cursorid ],
- };
- var cmdRes = this._db.runCommand(killCursorCmd);
- assert.commandWorked(cmdRes);
-
- this._cursorHandle.zeroCursorId();
- }
-}
-
/**
* Fills out this._batch by running a getMore command. If the cursor is exhausted, also resets
* this._cursorid to 0.