and( )


Adds an and condition to the query or filter.

The and() function adds an and condition to a WixDataQuery or WixDataFilter. A query or filter with an and returns all the items that match the query or filter as defined up to the and function and also match the query or filter passed to the and function.

Note that when chaining multiple WixDataFilter functions to a query an and condition is assumed. In such cases, you do not need to add a call to the and() function. For example, this query returns results where status is active and age is greater than 25.

Copy

The and() function is needed when performing compound queries. For example, the final query in this set of queries returns results where status is either pending or rejected and age is either less than 25 or greater than 65.

Copy

The collections referenced by both the initial query and the query passed to the and function must be the same.

The 'and()' function is designed to work with 2 or more queries or filters. If you use it on its own, it will return all the items in a collection.

Method Declaration
Copy
Method Parameters
queryWixDataQueryRequired

A query to add to the initial query as an and condition.

Returns
Return Type:WixDataQuery
Did this help?