I have the following data.
{
deviceID: 186,
date: \"2014-3-15\"
}
{
deviceID: 186,
date: \"2014-3-14\"
}
{
deviceID: 186,
date: \"201
This is because you are storing your data in a wrong format. You have a string an string
'15' is smaller than string '5'. Convert your strings in the beginning to date (read here how to use dates in mongo).
And only than you can use it to properly compare your dates:
db.coll.remove({
date:{
$lte : new Date(2012, 7, 14)
}
})