Obj.where(attribute, operator, value, boost)

Returns an ObjSearch with the given initial subquery based on the specified arguments.

Note that attribute and value can also be arrays for searching several attributes or values. For detailed information see ObjSearch.

Copy
blogPosts = [...Scrivito.Obj.where('_objClass', 'equals', 'BlogPost').order('publishedAt', 'desc')];

Params

  • attribute (String or Array<String>) - See ObjSearch for details.
  • operator (String) - See ObjSearch for details.
  • value (String or Array<String>) - See ObjSearch#and for details.
  • boost (optional) (Object) - See ObjSearch#and for details.

Returns

Returns an ObjSearch.

Example

Perform a full-text search and walk over the list of matching CMS objects.

Copy
objSearch = Scrivito.Obj.where("*", "containsPrefix", "web");
for (var obj of objSearch) {
  console.log(obj.get("title"));
}