I've an API in springboot which gets the data from mongo DB. This API accepts 4 filters:
- From Date
- To Date
- Name
- Role
Now, the user can send any of the filters or all filters. Example, if he passes just name and role, I should filter the data by name and role ignoring date fields. If he sends all values, I should filter by all fields. If he sends just from date, I should filter by from date ignoring all fields.
Can someone help me with this plesae?
Thank you