-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
QE 2022-09-19
There are queries in mongo that are valid which match on an empty field name (""). That means that documents such as these will be returned
{"": 1}
Initially it was brought to our attention that SBE does not support this, and we found the reason was that we have to treat empty strings in a special way when generating nested traversals in SBE. The way recursive path traversal is implemented in SBE, if we wanted to start supporting a query like this, we would have to remove the special meaning an empty string has in $elemMatch (https://github.com/mongodb/mongo/blob/8179692b362d8237f201719946eb46bac6a5e961/src/mongo/db/matcher/expression_parser.cpp#L1276), because otherwise the SBE traversal code cannot tell if an empty string is coming from this parser code or if the empty string is actually something that we are trying to match against. The correct solution would be to refactor the code that makes an empty string have a special meaning and instead perhaps use boost::optional, but that is a massive change that is very invasive since every match expression expects a StringData and not an optional.
- depends on
-
SERVER-64123 $elemMatch value predicate causes queries to accidentally fall back to the classic engine
- Closed
- related to
-
SERVER-64123 $elemMatch value predicate causes queries to accidentally fall back to the classic engine
- Closed
-
SERVER-69605 Complete TODO listed in SERVER-59757
- Closed
-
SERVER-57854 Changed behavior in SBE when filter is {"":null}
- Closed