
OPERATIONAL DEFECT DATABASE
...

...
The following aggregate command works on 6.0 but not on earlier versions: db.C.aggregate([{ $match : { $expr : { $eq : ['$$ROOT', { _id : 2, Name : 'Jane Doe' }] } } }])
charlie.swanson commented on Thu, 10 Nov 2022 19:51:43 +0000: Thanks for reporting robert@mongodb.com. We noticed this and fixed it, but didn't consider backporting. I checked the backport requested box and we'll triage that over in SERVER-64764
Create test data: db.C.insertMany([{ _id : 1, Name : "John Doe" }, { _id : 2, Name : "Jane Doe" }]) Execute command: db.C.aggregate([{ $match : { $expr : { $eq : ['$$ROOT', { _id : 2, Name : 'Jane Doe' }] } } }]) Expected result: > db.C.aggregate([{ $match : { $expr : { $eq : ['$$ROOT', { _id : 2, Name : 'Jane Doe' }] } } }]) [ { _id: 2, Name: 'Jane Doe' } ] Result in 5.0: > db.C.aggregate([{ $match : { $expr : { $eq : ['$$ROOT', { _id : 2, Name : 'Jane Doe' }] } } }]) MongoServerError: Failed to optimize pipeline :: caused by :: Failed to optimize expression :: caused by :: FieldPath::tail() called on single element path
Click on a version to see all relevant bugs
MongoDB Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.