summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHartek Sabharwal <hartek.sabharwal@mongodb.com>2021-03-02 18:03:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-23 00:04:43 +0000
commit801fc62596caee9c1c5aa6b4edf1a3e2ee857690 (patch)
tree14dd4da32d825fbc5f23a406d79f5944e866bce3
parentf38d74983adfd6d4f987172741cc7715edbdddcc (diff)
downloadmongo-801fc62596caee9c1c5aa6b4edf1a3e2ee857690.tar.gz
SERVER-54825 Use 'toArray()' in addition to array access after 'find()' in rslib.js
-rw-r--r--jstests/replsets/rslib.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/replsets/rslib.js b/jstests/replsets/rslib.js
index fc7b4fad1f5..84c7d8db92a 100644
--- a/jstests/replsets/rslib.js
+++ b/jstests/replsets/rslib.js
@@ -609,7 +609,8 @@ getFirstOplogEntry = function(conn) {
// "CappedPositionLost" error. This can be safely retried.
assert.soon(() => {
try {
- firstEntry = conn.getDB('local').oplog.rs.find().sort({$natural: 1}).limit(1)[0];
+ firstEntry =
+ conn.getDB('local').oplog.rs.find().sort({$natural: 1}).limit(1).toArray()[0];
return true;
} catch (e) {
if (e.code == ErrorCodes.CappedPositionLost) {