Document and test how to reset merge strategies

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Docs, Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Oleg Pudeyev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: