I am working on the product where user can upload the data and the datatype for the data will be picked up by the user dynamically while uploading. I am storing the data in mongodb. User can write the rule on front end to segment the data. One of the requirement is, the rule can be given such a way that find all the records whose date of birth is today. For that I might need to filter the document by day & month. As of now I am building the mongo query (java) as BasicDBObject dynamically based on rule given by user.
So filter needs to happen like $date.month=12 && $date.day=10 (to get all the records whose birth date fall under 10th of december).
Can some one help how it can be achieved in Mongo query?