Search...
exists( )
Syntax
function exists(propertyName: string, value: boolean): LocationsQueryBuilder
exists Parameters
NAME
TYPE
DESCRIPTION
propertyName
Optional
string
value
Optional
boolean
Returns
Return Type:
Was this helpful?
Add an
exists
filter to a queryCopy Code
1const query = locations.queryLocations.exists(2 'description',3 'some-description'4);5
Create a query, add an
exists
filter, and run itCopy Code
1import { locations } from 'wix-business-tools.v2';23export async function myQueryFunction() {4 const results = await locations5 .queryLocations()6 .exists('description', 'some-description')7 .find();89 if (results.items.length > 0) {10 const items = results.items;11 const firstItem = items[0];12 const pageSize = results.pageSize;13 const hasNext = results.hasNext();14 const hasPrev = results.hasPrev();15 const length = results.length;16 const query = results.query;1718 return items;19 } else {20 // Handle if no matching items found21 }22}23