Embedded matching in Mongoid failed to match documents where hashes with numeric keys were nested under arrays. For example:
document:
foo:
-
'42':
bar: 1
query:
foo.42.bar: 1
In this case, 42 is meant to be interpreted as the hash key, not as an array index.
https://jira.mongodb.org/browse/MONGOID-5063 earlier repaired a related problem of numeric keys being not matchable when they were in simple hashes (without array expansion being involved).
-------
Original report:
Mongoid::Matcher.expand_attribute() does not correctly handle numeric hash keys inside expanded arrays. This PR provides the fix + test cases: https://github.com/mongodb/mongoid/pull/4969
- is related to
-
MONGOID-5063 Support numeric path components as hash keys when embedded matching
- Closed
- links to