I have the following data.
{
deviceID: 186,
date: "2014-3-15"
}
{
deviceID: 186,
date: "2014-3-14"
}
{
deviceID: 186,
date: "2014-3-13"
}
And some lower dates like 2014-3-9 , 8 ,7 ,6etc.
While doing db.coll.remove({date:{$lte:"2014-3-5"}})
Mongo also deletes 15,14,13, but stores dates in one day. Perhaps this is due to the fact that the date is a string?
I do not know how else to format the date, so I can delete all dates below a certain date.
This is supposed to be a cleaning process by deleting all documents with a date below that specified.
source
share