mongoid/mongoid — Issue #1665: matches and highly nested queries issue
Author: apneadiving
Created: 2012-02-01 21:28:31+00:00
State: open

I have a `user` embedding one `profile`, embedding one `stats`, embedding many `jobs`. Pretty nested I know.

This query:

User.where(
"profile.stats.jobs".to_sym.matches => {
:rating.gte => 1,
:status => "approved
})

Spits:

TypeError: keys must be strings or symbols
from /gems/bson-1.4.0/lib/bson/bson_c.rb:24:in `serialize'

The very same query works whenever I remove `:rating.gte => 1`, which identifies the problem.

Is there any limitation to the `matches` nested level?

Thanks,

Ben