Search.../

in( )

Syntax

function in(propertyName: string, value: any): LocationsQueryBuilder

in Parameters

NAME
TYPE
DESCRIPTION
propertyName
Optional
string
value
Optional
any

Returns

Was this helpful?

Add an in filter to a query

Copy Code
1const query = locations.queryLocations.in(
2 ['labelIds', 'colors'],
3 ['red', 'blue', 'purple']
4);
5
Create a query, add an in filter, and run it

Copy Code
1import { locations } from 'wix-business-tools.v2';
2
3export async function myQueryFunction() {
4 const results = await locations
5 .queryLocations()
6 .in(['labelIds', 'colors'], ['red', 'blue', 'purple'])
7 .find();
8
9 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;
17
18 return items;
19 } else {
20 // Handle if no matching items found
21 }
22}
23