[SERVER-53007] Add $eq support to queryOperatorMap Created: 20/Nov/20  Updated: 29/Oct/23  Resolved: 03/Dec/20

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

Type: Task Priority: Major - P3
Reporter: PM Bot Assignee: James Wahlin
Resolution: Fixed Votes: 0
Labels: autogen-todo
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-19565 BSONElement::getGtLtOp() should inclu... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4
Sprint: Query 2020-12-14
Participants:

 Description   

Equality ($eq) was previously omitted from the queryOperatorMap because it is was used as the default return value for the MatchExpressionParser::parsePathAcceptingKeyword method when an operator was not recognized. Since then MatchExpressionParser::parsePathAcceptingKeyword has been modified to return a boost::optional and we can now differentiate.

As part of this work we should also remove the TODO for SERVER-19565 which called out the above omission.



 Comments   
Comment by Githook User [ 03/Dec/20 ]

Author:

{'name': 'James Wahlin', 'email': 'james@mongodb.com', 'username': 'jameswahlin'}

Message: SERVER-53007 Add $eq support to queryOperatorMap
Branch: master
https://github.com/mongodb/mongo/commit/46ed0d855de5174ba5bddbc17acc8c4eab32e881

Comment by James Wahlin [ 02/Dec/20 ]

It is worth noting that a side affect of this change is that $pull will now accept $eq, where it previously would fail:

> db.test.update({}, {$pull: {fruits: {$eq: "pears"}}})
WriteResult({
	"nMatched" : 0,
	"nUpserted" : 0,
	"nModified" : 0,
	"writeError" : {
		"code" : 2,
		"errmsg" : "unknown top level operator: $eq"
	}
})

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