-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query
Taking the merge strategy example in https://www.mongodb.com/docs/mongoid/master/reference/queries/#merge-strategies and expanding it to operate over a criteria that places the conditions under $and, we get incorrect results:
irb(main):005:0> Band.where(name: {:$in => 42}).in(name: ['a']).override.in(name: ['b']) => #<Mongoid::Criteria selector: {"name"=>{"$in"=>["b"]}, "$and"=>[{"name"=>{"$in"=>["a"]}}]} options: {} class: Band embedded: false>
You might expect that `b` would replace `a`, instead the earlier `42` got replaced by `b` and `a` is still there.
If we are not able to come up with a solution, we should at least document this issue.
- is depended on by
-
MONGOID-5349 Implement merge strategies for all operators
- Blocked
- links to