count()

The total number of search results.

Copy
Scrivito.Obj.where("_objClass", "equals", "BlogPost").count();

Returns

Number – the total number of search results.

Remarks

The returned value is always the total number of results, irrespectively of whether an offset is given or not.

Example

Count the Page objects in the CMS:

Copy
console.log(Scrivito.getClass("Page").all().count());