ne( )


Refines a query to match items whose specified property value does not equal the specified value.

The ne() function refines a SessionQueryBuilder to only match items where the value of the specified property does not equal the specified value.

The ne() function only supports the recurrence property for null values. Use .ne("recurrence",null) to query recurring sessions together with .eq("sessionId", "").

Method Declaration
Copy
function ne(propertyName: string, value: any): SessionQueryBuilder;
Method Parameters
propertyNamestringRequired

The property whose value will be compared with value. Supported properties:

  • recurrence

valueanyRequired

The value to match against.

Returns
Add a not equals filter to a query
JavaScript
import { sessions } from "wix-bookings-backend"; // ... sessions .querySessions() .ne("recurrence", null) .eq("scheduleId", "9299760d-8a4a-4f89-b348-1fc611f4be17") .ge("end.timestamp", "2020-01-01T08:00:00.000Z") .lt("start.timestamp", "2021-06-01T08:00:00.000Z") .find({ suppressAuth: true }) .then((results) => { if (results.items.length > 0) { const items = results.items; const firstItem = items[0]; const totalCount = results.totalCount; const pageSize = results.pageSize; const currentPage = results.currentPage; const totalPages = results.totalPages; const hasNext = results.hasNext(); const hasPrev = results.hasPrev(); const length = results.length; const query = results.query; } else { // handle case where no matching items found } }) .catch((error) => { console.error(error); });
Errors

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

Did this help?