You have two options. The first is to use an operator $where.
Collection.find( { $where: "this.start === this.end" } )
The second option is to use the aggregation structure and the operator $redact.
Collection.aggregate([
{ "$redact": {
"$cond": [
{ "$eq": [ "$start", "$end" ] },
"$$KEEP",
"$$PRUNE"
]
}}
])
Which one is better?
$where JavaScript , $where . . considerations. $, BSON JavaScript $where, . , , . , .
$redact, $where, , , $redact, MongoDB. , $match.
$where , . , $where, . , .