I read the $gt attribute has to be used. Not able to get around this. Let's say I have some mongo data like this:
{
"startTime" : "Sun 25 Jan 2015 07:14:26 GMT",
"endTime" : "",
"jobStatus" : "JOBCANCELLED",
"uiState" : "HISTORY",
"priority" : "SILVER"
}
That's how my start time is saved in my Mongo. If I want to get the statuses of all jobs which have the start time greater than today, How do I do it?
db.getCollection('jobsCollection').find({"startTime":{$gt: "What here?"})
First you need to convert your startTime from String format to date time format.
To do from mongo shell :
And then you can write the query for greater than date :
Let me know if you face any issue.