Scrivito is proudly made by JustRelate Group in Berlin, Germany, and Wrocław, Poland.
Scrivito is proudly made by JustRelate Group
New in 1.18.0

where(attribute, operator, value, boost)

Returns an ObjSearch with the given initial subquery based on the specified arguments. The search returns only CMS objects that are part of the site context.

frenchSite = Scrivito.Obj.onSite('fr');
search = frenchSite.where('title', 'contains', 'salut');
salutations = await Scrivito.load(() => search.take());

console.log(salutations.map((page) => page.get("title")));

Params

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

Returns

ObjSearch - An ObjSearch scoped to the site of the SiteContext.

See also

Obj.where