Search...
ne( )
Refines a query to match items whose specified property value does not equal the specified value.
Description
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", "<value>")
.
Syntax
function ne(propertyName: string, value: *): SessionQueryBuilder
ne Parameters
NAME
TYPE
DESCRIPTION
propertyName
string
The property whose value will be compared with value
.
Supported properties:
recurrence
value
*
The value to match against.
Was this helpful?
Add a not equals filter to a query
Copy Code
1import { sessions } from "wix-bookings-backend";23// ...45sessions.querySessions()6 .ne("recurrence", null)7 .eq("scheduleId", "9299760d-8a4a-4f89-b348-1fc611f4be17")8 .ge("end.timestamp","2020-01-01T08:00:00.000Z")9 .lt("start.timestamp","2021-06-01T08:00:00.000Z")10 .find({suppressAuth:true})11 .then((results) => {12 if (results.items.length > 0) {13 const items = results.items;14 const firstItem = items[0];15 const totalCount = results.totalCount;16 const pageSize = results.pageSize;17 const currentPage = results.currentPage;18 const totalPages = results.totalPages;19 const hasNext = results.hasNext();20 const hasPrev = results.hasPrev();21 const length = results.length;22 const query = results.query;23 } else {24 // handle case where no matching items found25 }26 })27 .catch((error) => {28 console.error(error);29 });