How can I make a query with AND condition in Mongoid?
You can chain where
statements or include multiple conditions to the where
call.
Model.where(condition_a: :a, condition_b: :b).all
or
Model.where(condition_a: :a).where(condition_b: :b).all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With