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.
- related to
-
MONGOID-4854 Backward compatibility problem with Criteria::Queryable::Selectable#where with nil argument
- Closed