How to apply OR conditions to collection in Magento 2?

In Magento 2, You can apply OR conditions on collection. By default, When you work with collection, Your conditions will be AND.

AND Condition
Fetch collection of only those products whose sku is like 24MB% AND type_id is equal to simple.

Output:
SELECT e.* FROM catalog_product_entity AS e WHERE (e.sku LIKE ’24MB%’) AND (e.type_id = ‘simple’); Continue reading “How to apply OR conditions to collection in Magento 2?”