Search.../

totalCount

Returns the total number of items that match the query.

Description

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

Type:

undefined

 | 

number

Was this helpful?

Get totalCount from a query result

Copy Code
1const resultCount = results.totalCount;
2
Perform a query and get totalCount from the result

Copy Code
1import { tags } from 'wix-blog-backend';
2
3export async function myQueryFunction() {
4 const results = await tags.queryTags().find();
5
6 return results.totalCount;
7}
8