summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_change_stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/document_source_change_stream.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_change_stream.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_change_stream.cpp b/src/mongo/db/pipeline/document_source_change_stream.cpp
index 012c16ffbaa..82a1b177e92 100644
--- a/src/mongo/db/pipeline/document_source_change_stream.cpp
+++ b/src/mongo/db/pipeline/document_source_change_stream.cpp
@@ -177,8 +177,10 @@ BSONObj getTxnApplyOpsFilter(BSONElement nsMatch, const NamespaceString& nss) {
BSONObjBuilder applyOpsBuilder;
applyOpsBuilder.append("op", "c");
- // "o.applyOps" must be an array with at least one element
- applyOpsBuilder.append("o.applyOps.0", BSON("$exists" << true));
+ // "o.applyOps" stores the list of operations, so it must be an array.
+ applyOpsBuilder.append("o.applyOps",
+ BSON("$type"
+ << "array"));
applyOpsBuilder.append("lsid", BSON("$exists" << true));
applyOpsBuilder.append("txnNumber", BSON("$exists" << true));
applyOpsBuilder.append("o.prepare", BSON("$not" << BSON("$eq" << true)));