VPS business hosting starting at $29.95/24/7 premium technical support

Condition types for addAttributeToFilter in Magento2 Collections

'eq'            => "{{column}} = ?",
'finset'        => "FIND_IN_SET(?, {{column}})",
'from'          => "{{column}} >= ?",
'gt'            => "{{column}} > ?",
'gteq'          => "{{column}} >= ?",
'in'            => "{{column}} IN(?)",
'is'            => "{{column}} IS ?",
'like'          => "{{column}} LIKE ?",
'lt'            => "{{column}} < ?",
'lteq'          => "{{column}} <= ?",
'neq'           => "{{column}} != ?",
'nin'           => "{{column}} NOT IN(?)",
'nlike'         => "{{column}} NOT LIKE ?",
'notnull'       => "{{column}} IS NOT NULL",
'ntoa'          => "INET_NTOA({{column}}) LIKE ?",
'null'          => "{{column}} IS NULL",
'regexp'        => "{{column}} REGEXP ?",
'seq'           => null,
'sneq'          => null,
'to'            => "{{column}} <= ?"

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

Leave a Reply

Your email address will not be published. Required fields are marked *