summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {