Search...
ne( )
Refines a query to match items whose specified property value does not equal the specified value.
Description
The ne()
function refines a CreateRequestsQueryBuilder
to only
match items where the value of the specified property does not equal the specified value
.
It only matches values of the same type. For example, a number value stored as a String type does not match the same number stored as a Number type.
Matching strings with ne()
is case sensitive, so "text"
is not equal to "Text"
.
Syntax
function ne(propertyName: string, value: *): CreateRequestsQueryBuilder
ne Parameters
NAME
TYPE
DESCRIPTION
propertyName
string
The property whose value will be compared with value
.
Supported property:
status
value
*
The value to match against.
Returns
A CreateRequestsQueryBuilder
object representing the refined query.
Return Type:
Was this helpful?
Add an
ne
filter to a queryCopy Code
1const query = createRequests.queryCreateRequests().ne("status", "APPROVED");
Create a query, add an
ne
filter, and run itCopy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { createRequests } from 'wix-groups-backend';34export const myQueryCreateRequestsFunction = webMethod(Permissions.Anyone, () => {56 return createRequests.queryCreateRequests()7 .ne("status", "APPROVED")8 .find()9 .then((results) => {10 if (results.items.length > 0) {11 const items = results.items;12 const firstItem = items[0];13 const pageSize = results.pageSize;14 const totalPages = results.totalPages;15 const totalCount = results.totalCount;16 const currentPage = results.currentPage();17 const next = results.next();18 const previous = results.prev();19 const hasNext = results.hasNext();20 const hasPrev = results.hasPrev();21 const length = results.length;2223 return items;24 } else {25 // Handle case where no matching items found26 }27 })28 .catch((error) => {29 console.error(error);30 })3132});