and( )

Adds an and condition to the query.

The and() function adds an and condition to a PublicPlansQueryBuilder. A query with an and returns all the items that match the query as defined up to the and function.

Note that when chaining multiple PublicPlansQueryBuilder 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 the plan was created during a certain date range and the plan's slug starts with "gold" (such as gold, gold-vip, gold-trial).


The and() function is needed when performing compound queries. For example, the final query, typeAndDateQuery, in this set of queries returns results where a plan is created after a certain date, and the plan is either a "gold" or a "silver" membership plan, as defined in the plan's slug.


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
This method does not take any parameters
Was this helpful?