cursors


cursorsCursors

Returns the query cursors.

cursors returns the query's next and prev cursors.

Get the query's cursors
JavaScript
import { backInStockNotifications } from "wix-ecom-backend"; export async function myQueryFunction() { const results = await backInStockNotifications .queryBackInStockNotificationRequests() .find(); const cursors = results.cursors; }
Did this help?

items


itemsArray<BackInStockNotificationRequest>

Returns an array of backInStockNotifications items that match the query.

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 backInStockNotifications to navigate the pages of a query result.

JavaScript
const returnedItems = results.items;
Did this help?

length


lengthnumber

Returns the number of items in the current page of results.

length returns just the number of items in the current page, not the total number of items that match the query. For the total number of items that match the query, see totalCount. 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 backInStockNotifications to navigate the pages of a query result.

JavaScript
const resultLength = results.length;
Did this help?

pageSize


pageSizenumber

Returns the requested page size.

pageSize returns the page size set in limit() in RequestsQueryBuilder.

JavaScript
const requestedPageSize = results.pageSize;
Did this help?

query


Returns the RequestsQueryBuilder object used to get the current results.

Use query to create and run a new query by chaining additional RequestsQueryBuilder functions to it. You can filter only on properties that haven't already been used in the previous RequestsQueryBuilder.

JavaScript
const originalQuery = results.query;
Did this help?

hasNext( )


Indicates whether the query has more results.

You can use the next() and prev() functions returned by backInStockNotifications to navigate the pages of a query result.

Method Declaration
Copy
function hasNext(): boolean;
Request
This method does not take any parameters
Returns
Return Type:boolean
JavaScript
const hasNext = results.hasNext();
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

hasPrev( )


Indicates whether the query has previous results.

You can use the next() and prev() functions returned by backInStockNotifications to navigate the pages of a query result.

Method Declaration
Copy
function hasPrev(): boolean;
Request
This method does not take any parameters
Returns
Return Type:boolean
JavaScript
const hasPrev = results.hasPrev();
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

next( )


Retrieves the next page of query results.

The next() function retrieves the next page of query results. 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 backInStockNotifications to navigate the pages of a query result. If items are added or removed between calls to next(), the values returned by RequestsQueryBuilder may change.

Method Declaration
Copy
function next(): Promise<RequestsQueryResult>;
Request
This method does not take any parameters
Returns
Return Type:Promise<RequestsQueryResult>
JavaScript
const nextPage = results.next();
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

prev( )


Retrieves the previous page of query results.

The prev() function retrieves the previous page of query results. 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 backInStockNotifications to navigate the pages of a query result. If items are added or removed between calls to prev(), the values returned may change.

Method Declaration
Copy
function prev(): Promise<RequestsQueryResult>;
Request
This method does not take any parameters
Returns
Return Type:Promise<RequestsQueryResult>
JavaScript
const previousPage = results.prev();
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?