ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.6.3
    • Affects Version/s: 7.6.1
    • Component/s: None
    • None
    • None
    • Fully Compatible
    • Ruby Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      On the 7.6 branch, any_of with more than one hash criterion bypasses the query-operator guard, so that (e.g.) Band.any_of({'$where' => '...'}, {name: 'x'}) builds a selector containing a top-level $where even when Mongoid.allow_unsafe_query_operators is false.

      Reproduction (7.6, allow_unsafe_query_operators = false):

      Band.any_of({'$where' => 'this.name == "admin"'}, {name: 'x'}).selector
      # => {"$or" => [{"$where" => "..."}, {"name" => "x"}]}
      

            Assignee:
            Jamis Buck
            Reporter:
            Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: