hasSome( )
Refines a query to match items whose specified property contains any of the specified value
parameters.
Description
The hasSome()
function refines a ResourceCatalogQueryBuilder
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>): ResourceCatalogQueryBuilder
hasSome Parameters
NAME
TYPE
DESCRIPTION
The property whose values will be compared with value
.
Supported properties:
_id
slugs.name
The values to match against.
Returns
A ResourceCatalogQueryBuilder
object representing the refined query.
Return Type:
Was this helpful?
1let query = resources.queryResourceCatalog().hasSome("slugs.name", ["john-smith", "jane-doe", "jack-black"]);
1import { resources } from "wix-bookings-backend";23// ...45resources.queryResourceCatalog()6 .hasSome("slugs.name", ["john-smith", "jane-doe", "jack-black"])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 });