summaryrefslogtreecommitdiff
path: root/src/mongo/shell/query.js
diff options
context:
space:
mode:
authorCheahuychou Mao <cheahuychou.mao@mongodb.com>2020-02-24 22:48:22 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-28 19:54:40 +0000
commit0219d8e3489f7934c3eda10a18ac70de81d1e7b4 (patch)
tree9b29a85adfdf1470b84f72e8fdd2f03ca667403d /src/mongo/shell/query.js
parentbd05da2372a83bdbe2efa1f488a893a9ea40530c (diff)
downloadmongo-0219d8e3489f7934c3eda10a18ac70de81d1e7b4.tar.gz
SERVER-9391 tailable cursors should throw an exception in DBClientCursor when a cursor is not found on the server
Diffstat (limited to 'src/mongo/shell/query.js')
-rw-r--r--src/mongo/shell/query.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/shell/query.js b/src/mongo/shell/query.js
index bd451166e9d..cbdbeda2929 100644
--- a/src/mongo/shell/query.js
+++ b/src/mongo/shell/query.js
@@ -328,6 +328,11 @@ DBQuery.prototype.readOnly = function() {
return this;
};
+DBQuery.prototype.getId = function() {
+ this._exec();
+ return this._cursor.getId();
+};
+
DBQuery.prototype.toArray = function() {
if (this._arr)
return this._arr;
@@ -876,6 +881,9 @@ DBCommandCursor.prototype.objsLeftInBatch = function() {
return this._cursor.objsLeftInBatch();
}
};
+DBCommandCursor.prototype.getId = function() {
+ return this._cursorid;
+};
DBCommandCursor.prototype.getResumeToken = function() {
// Return the most recent recorded resume token, if such a token exists.
return this._resumeToken;