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

Implement eq symbol operator

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

      Mongoid appears to implement all comparison operators as methods on symbols except eq:

      (byebug) MyModel.any_of(:field.ne => 'x')
      #<Mongoid::Criteria
        selector: {"field"=>{"$ne"=>"x"}}
        options:  {}
        class:    MyModel
        embedded: false>
      (byebug) MyModel.any_of(:field.eq => 'x')
      *** NoMethodError Exception: undefined method `eq' for :field:Symbol
      
      

            Assignee:
            dmitry.rybakov@mongodb.com Dmitry Rybakov
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: