Per the discussion in https://jira.mongodb.org/browse/MONGOID-4860, it is indeed somewhat awkward to write:
Foo.and(Foo.or(condition1, condition2))
We should investigate repurposing any_of to achieve this without the and, as follows:
Foo.any_of(condition1, condition2)
Such that the following expresses that condition 1 must be true or either of conditions 2 and 3 must be true:
Foo.where(condition1).any_of(condition2, condition3)
If Mongoid 7.0 behaves in this manner, I think it would be helpful for Mongoid 7.1.1 to reinstate this behavior of any_of, and leave `or` behave as it currently does in 7.1.0.
- is duplicated by
-
MONGOID-4855 Document any_of
- Closed
- related to
-
MONGOID-4860 Document Foo.or(...) -> Foo.and(Foo.or(...)) migration path
- Closed
- links to