queryDiscountRules( )


Creates a query to retrieve a list of discount rules.

The queryDiscountRules() function builds a query to retrieve a list of up to 100 discount rules, and returns a DiscountRulesQueryBuilder object.

The returned object contains the query definition which is typically used to run the query using the find() function.

You can refine the query by chaining DiscountRulesQueryBuilder functions onto the query. DiscountRulesQueryBuilder functions enable you to sort, filter, and control the results queryDiscountRules() returns.

By default, queryDiscountRules() sorts results by ascending("_id") by default. This can be overridden.

To learn how to query posts, refer to the table below.

The following DiscountRulesQueryBuilder functions are supported for the queryDiscountRules() function. For a full description of the discount rule object, see the object returned for the items property in the DiscountRulesQueryResult.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),exists(),in(),hasSome(),startsWith(),ascending(),descending()
revisioneq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge(),ascending(),descending()
_createdDateeq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge(),ascending(),descending()
_updatedDateeq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge(),ascending(),descending()
activeeq(),ne(),exists(),in(),hasSome(),ascending(),descending()
nameeq(),ne(),exists(),in(),hasSome(),startsWith(),ascending(),descending()
activeTimeInfo.starteq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge(),ascending(),descending()
activeTimeInfo.endeq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge(),ascending(),descending()
Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Stores - all permissions
Read eCommerce - all read permissions
Read Stores - all read permissions
Manage eCommerce - all permissions
Learn more about app permissions.
Method Declaration
Copy
Request
This method does not take any parameters
Returns
Was this helpful?
Yes
No