Create query method in Spring Data MongoDB using regex for date fields

  • Bid1
  • Budget $50.00
  • Average Bid $50.00
  • Location USA

Posted on October 13, 2024

Completed

Project Desciption

This query is working fine in MongoDB Compass.

{ createdDateTime:  {$lt : ISODate(“2024-10-13T01:30:00.000Z”)}}

However it’s not giving any result when used in Spring Data MongoDB using regex in Java.

Example query method

@Query(“{‘createdDateTime’ : { $regex: ?0, $options: ‘i’ }}”)

List<User> findAllWithRegEx(String createdDateTimeRegEx);

Skills Required

JavaMongoDB

Milestones

  • Working code snippet.
  • Short screen captures video with voice explaining the working solution.

Employer Information

1 project(s) posted hire 1 freelancers USA
Member since: October 14, 2024
FREELANCER BIDDING (1)

Lakshmi Fullstack Developer

Experienced Full Stack Developer

USA

Only project owner can view this information.