how do i query mongodb to find out if a date in the database is within 1 week from today?
i tried stuff MongoRepository query for between dates but i kept getting an error
Class
POJO class {
private String id;
private String userId;
private String userName;
private String email;
private Date changeDate;
}
Mongo Repo
public interface POJOREPO extends MongoRepository<POJO, String> {
POJOCLASS findByUserIdAndFindTopByOrderByChangeDateDesc(String userId, Date todayDate);
}
I would like it to return either a boolean or the entity meaning the date is within a week from the current date