I have this query in my api:
@Query("{$and: ["
+ "{'online': ?5}, "
+ "{'locations.appointmentTimeRanges.weekday': ?6}, "
+ "{'specialties.name': ?7}, "
+ "{'healthInsurances.name' : ?8}"
+ "]}")
I need that when passing the parameters, when it does not come some filled field should disregard certain filter.
Example: Only online and weekday came as a parameter, as it is also looking for specialties.name and healthInsurances.name as being empty and does not find anything.
I want it at both times it looks for all the attributes together or for some sent by the client, ignoring the filter in which the parameter did not come populated. As in my example did not come specialties.name and healthInsurances.name I want to ignore them in the search.
I hope you understood my question.