how can we convert string with format mm/dd/yyyy to Date ISO format, which can be passed as an input to mongo db Query using java ?
eg: Input format for string is 11/30/2022 which needs to converted into ISODate("2022-11-30T00:00:00.000+0000")
Update:
Added the below code snippet which generated the date and passed to the query as shown in the below image and i'm using mongoTemplate to execute the query.
mongoTemplate.find(query, Packet.class);
When the codeis executed it returns empty even though there is a record for the given input.
Ran this directly in mongodb client and it doesn't return anything.
But when I update the query to in mongodb client, by adding ISODate() it returns the correct response.
So wondering where i'm making a mistake!!