Nested $and and $or Query in Mongoid 3

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 3.0.15
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hello.

      In Mongoid 2 I can write query like this:

      Note.where{"$and" => [{"$or" => [{:message.exists => true}, {:message.ne => 'Hello'}]}, {"$or" =>[{:message_alarm.exists => true},{:message_alarm.ne => "mute"}]}]}
      

      However this syntax is no longer feasible in Mongoid 3, so is there a way to write something like that in Mongoid 3 ?

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

              Created:
              Updated:
              Resolved: