Search.../

totalCount

Returns the total number of items that match the query.

Description

The totalCount returns the total number of items that match the query, not just the number of items in the current page.

Type:

numberRead Only

Was this helpful?

Get the number of items in a query result

Copy Code
1let resultCount = results.totalCount; // 150
Perform a query, get the query that produced the results and modify it

Copy Code
1import { sessions } from "wix-bookings-backend";
2
3// ...
4
5sessions.querySessions()
6 .ge("end.timestamp", "2021-01-01T00:00:00.000Z")
7 .lt("start.timestamp", "2021-05-01T00:00:00.000Z")
8 .find()
9 .then((results) => {
10 let resultCount = results.totalCount; // 150
11 })
12 .catch((error) => {
13 console.error(error);
14 });