[SERVER-54332] [SBE] $elemMatch with object filter returns no documents Created: 05/Feb/21  Updated: 29/Oct/23  Resolved: 13/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Nikita Lapkov (Inactive) Assignee: Drew Paroski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query Execution 2021-03-08, Query Execution 2021-03-22
Participants:
Linked BF Score: 167

 Description   

 

> db.test.find()
{ "_id" : ..., "a" : [ ] }
{ "_id" : ..., "a" : [ 1, 2, 3 ] }
{ "_id" : ..., "a" : [ {c: 1} ] }

 

[Classic Engine]
> db.test.find({a: {$not: {$elemMatch: {b: 1}}}}).toArray()
[
 { "_id" : ..., "a" : [ ] },
 { "_id" : ..., "a" : [ 1, 2, 3 ] },
 { "_id" : ..., "a" : [ {c: 1} ] }
]

 

[SBE]
> db.test.find({a: {$not: {$elemMatch: {b: 1}}}}).toArray()
[ ]

 



 Comments   
Comment by Githook User [ 13/Mar/21 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-54332 [SBE] $elemMatch with object filter returns no documents
Branch: master
https://github.com/mongodb/mongo/commit/a90fee27ae85894ae6e4522251fe0ea35ef473c7

Comment by Githook User [ 12/Mar/21 ]

Author:

{'name': 'Sviatlana Zuiko', 'email': 'sviatlana.zuiko@mongodb.com', 'username': 'szuiko'}

Message: Revert "SERVER-54332 [SBE] $elemMatch with object filter returns no documents"

This reverts commit 8b8c06cf8551ac34943cf81ab89dbf97ce8acd98.
Branch: master
https://github.com/mongodb/mongo/commit/64aaf4f7d91fdd53f9adf3f233da5664ffcff183

Comment by Githook User [ 12/Mar/21 ]

Author:

{'name': 'Mickey. J Winters', 'email': 'mickey.winters@mongodb.com', 'username': 'mjrb'}

Message: SERVER-54332 [SBE] $elemMatch with object filter returns no documents
Branch: master
https://github.com/mongodb/mongo/commit/8b8c06cf8551ac34943cf81ab89dbf97ce8acd98

Generated at Thu Feb 08 05:33:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.