andNot(attribute, operator, value)

Adds a negated “and” subquery to the given ObjSearch instance.

Compares the attribute value(s) with the given value(s) using the negated operator of this subquery. All CMS objects to which this criterion applies are removed from the result set.

Params

  • attribute (String or Array<String>) – Name(s) of the attributes(s) to be searched. For arrays, the subquery matches if one or more of these attribute values meet this criterion.
  • operator (String) – Must be one of: equals, startsWith, isGreaterThan, isLessThan (see Search operators).
  • value (String, Date, Time, Number, Obj, or Array) – The value(s) to compare with the attribute value(s) using the operator of this subquery. For arrays, the subquery matches if the condition is met for at least one array element.

Returns

ObjSearch - Itself

Example

Find all BlogPost CMS objects whose “tags” stringlist value doesn’t include “fiction”.