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

Document and test how to reset merge strategies

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Docs, Query
    • None

      Our documentation for merge strategies (http://docs.mongodb.com/mongoid/master/tutorials/mongoid-queries/#merge-strategies) does not say how to reset the activated merge strategy. This was mentioned in https://jira.mongodb.org/browse/MONGOID-4854 and I suggested the use of #all:

      irb(main):002:0> Band.in(foo: 'bar').union.in(foo: 'baz')
      => #<Mongoid::Criteria
        selector: {"foo"=>{"$in"=>["bar", "baz"]}}
        options:  {}
        class:    Band
        embedded: false>
      
      irb(main):003:0> Band.in(foo: 'bar').union.all.in(foo: 'baz')
      => #<Mongoid::Criteria
        selector: {"foo"=>{"$in"=>[]}}
        options:  {}
        class:    Band
        embedded: false>
      

      This use case should be documented and added to the test suite.

      The section referenced is also misformatted for the list of strategies, which should be remedied.

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

              Created:
              Updated: