and( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Adds an and condition to the search filter.

The and() method adds an and condition to the search filter. A search with an and returns all the items that match both the filter as defined up to the and() method, and the filter passed to the and() method.

When chaining multiple filter methods to a search, an and condition is often assumed by default. For example, the search returns results whose status is active and age is greater than 25:

Copy

The and() method is needed when using compound filters. For example, the final search in this set of operations returns results whose status is either pending or rejected and age is either less than 25 or greater than 65:

Copy

Note: The and() method requires 2 or more filters.

Method Declaration
Copy
Method Parameters
filterWixDataFilterRequired

Filter to add to the initial search filter as an and condition.

Returns
Return Type:WixDataSearch
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?