When we compare the nested object representing the JavaScript scope in an element of BSONType::CodeWScope, we pass through the StringData comparator:
https://github.com/mongodb/mongo/blob/r3.4.0-rc5/src/mongo/bson/bsonelement.cpp#L1005
This is incorrect, since only BSONType::String, or String nested inside Object or Array, should ever use custom string comparison semantics. This means that queries may compare CodeWScope elements incorrectly.
- is related to
-
SERVER-27195 Symbol BSON type compares incorrectly with String when the collation is non-simple
- Backlog
-
SERVER-27197 Code BSON type should not be compared using a collation-aware string comparator
- Closed