Skip to content

Commit 8f46f20

Browse files
committed
Add a comment about $bsonSize.
1 parent e987143 commit 8f46f20

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/verifier/change_stream.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ func (verifier *Verifier) HandleChangeStreamEvents(ctx context.Context, batch []
102102
return verifier.insertRecheckDocs(ctx, dbNames, collNames, docIDs, dataSizes)
103103
}
104104

105+
// GetChangeStreamFilter returns an aggregation pipeline that filters
106+
// namespaces as per configuration.
107+
//
108+
// NB: Ideally we could make the change stream give $bsonSize(fullDocument)
109+
// and omit fullDocument, but $bsonSize was new in MongoDB 4.4, and we still
110+
// want to verify migrations from 4.2. fullDocument is unlikely to be a
111+
// bottleneck anyway.
105112
func (verifier *Verifier) GetChangeStreamFilter() []bson.D {
106113
if len(verifier.srcNamespaces) == 0 {
107114
return []bson.D{{bson.E{"$match", bson.D{{"ns.db", bson.D{{"$ne", verifier.metaDBName}}}}}}}

0 commit comments

Comments
 (0)