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

Add .none_of query method

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.1.0
    • Affects Version/s: None
    • Component/s: Query

      Currently in Mongoid the and, or and nor methods consider the receiver one of the operands. For and this doesn't matter, for or and nor this makes a difference. not does not consider the receiver one of the operands but it has a mode of operation (the argument-less invocation) where it flips the meaning of the next condition, which is essentially action-at-a-distance.

      Mongoid provides the any_of method which only considers its arguments its operands, i.e. it adds a disjunction of its operands to the query using 'and'.

      (There is also all_of that follows the same naming convention, however it is equivalent to .and in all uses.)

      We should add none_of method to Mongoid which will behave as not with arguments, that is, it will have no possibility of altering the meaning of other conditionals and will just act on its direct arguments. This method will be easier for users of Mongoid to use correctly.

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: