hasSome( )
Refines a query to match items whose specified property contains any of the specified value
parameters.
Description
The hasSome()
function refines a BookingsQueryBuilder
to only match items where the value of the specified property equals any of the specified values in the array.
Matching strings with hasSome()
is case sensitive, so "text"
is not equal to "Text"
.
You can specify a list of values to match by providing comma-separated String types as the value
parameters. You can also specify a list of these values by including them in an array and providing the array as the value
.
Syntax
function hasSome(propertyName: string, value: Array<string>): BookingsQueryBuilder
hasSome Parameters
NAME
TYPE
DESCRIPTION
The property whose values will be compared with value
.
Supported properties:
sessionId
status
The values to match against.
Returns
A BookingsQueryBuilder
object representing the refined query.
Return Type:
Was this helpful?
1let query = bookings.queryBookings().hasSome("status", ["PENDING_CHECKOUT", "PENDING", "PENDING_APPROVAL"]);
1import { bookings } from "wix-bookings-backend";23// ...45bookings.queryBookings()6 .hasSome("status", ["PENDING_CHECKOUT", "PENDING", "PENDING_APPROVAL"])7 .find()8 .then((results) => {9 if (results.items.length > 0) {10 const items = results.items;11 const firstItem = items[0];12 const totalCount = results.totalCount;13 const pageSize = results.pageSize;14 const currentPage = results.currentPage;15 const totalPages = results.totalPages;16 const hasNext = results.hasNext();17 const hasPrev = results.hasPrev();18 const length = results.length;19 const query = results.query;20 } else {21 // handle case where no matching items found22 }23 })24 .catch((error) => {25 console.error(error);26 });