Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1666

matches and highly nested queries issue

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.4.4
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      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.

      Thanks,

      Ben

            Assignee:
            Unassigned Unassigned
            Reporter:
            apneadiving apneadiving
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: