Skip to content

Query Filters

You can filter and do some mongo db operations via get request parameter of a URL, crud-router now supports multiple operators from mongo db from query params

Greater Than Operator

This operator is used to fetch or filter api response data by a greater than condition.

Usage of Grater than Operator
GET /users?age=gt-18
  • Above query is return all users with age above 18 years.

Less Than Operator

This operator is used to fetch or filter api response data by a less than condition.

Usage of Less than Operator
GET /users?age=lt-18
  • Above query is return all users with age below 18 years.

In Operator

This operator helps to filter the response by a group of values.

Usage of In Operator
GET /orders?payment_method=in-card,cash_on_delivery
  • Above query will return all orders has the payment_method card or cash on delivery or both.