Search.../

items

Returns an array of categories items that match the query.

Description

items contains the current page of results retrieved by the query. If no results match the query, items is an empty array. The page size is defined by the limit() function and can be retrieved using the pageSize property. You can use the next() and prev() functions returned by categories to navigate the pages of a query result.

Type:

Array<
Category
>
NAME
TYPE
DESCRIPTION
_id
string

Category ID.

coverImage
string

Category cover image.

coverMedia
CoverMedia

Reserved for internal use.

description
string

Category description.

displayPosition
number

Position of the category in the Category Menu. Categories with lower display position are displayed first.

internalId
string

Reserved for internal use.

label
string

Category label. Displayed in the Category Menu.

language
string

Category Language.

2-letter language code in ISO 639-1 format.

oldRank
number

Reserved for internal use.

postCount
number

Number of posts in the category.

rank
number

Reserved for internal use.

seoData
SeoSchema

SEO data.

slug
string

Part of a category's URL that refers to a specific category.

For example, 'https:/example.com/blog/category/{my-category-slug}'.

title
string

Category title.

translationId
string

ID of the category's translations when Wix Multilingual is installed on a site. All translations of a single category will share the same translationId.

url
string

Category URL.

The url directs you to a page that lists every post with the specified category.

Was this helpful?

Get items from a query result

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

Copy Code
1import { categories } from 'wix-blog-backend';
2
3export async function myQueryFunction() {
4 const results = await categories.queryCategories().find();
5
6 const returnedItems = results.items;
7
8 if (returnedItems.length > 0) {
9 return items;
10 } else {
11 // Handle if no matching items found
12 }
13}
14