I’m trying to do a query in a MongoDB database with date values but the following situation is occurring:
Filtering with date only goes all normal …
Filter: filter:{“$and”:[ {“dt_evento”:{“$date”:“2016-11-28T23:21:43.0000”}} ]}
{
“resource”: [
{
“_id”: “583cbc0819e33f052c019c06”,
“bem_id”: 22,
“dt_evento”: {
“$date”: “2016-11-28T23:21:43+0000”
},
“dt_gps”: {
“$date”: “2016-11-28T23:21:43+0000”
},
“latitude”: -24.281786,
“longitude”: -53.840725,
“velocidade”: 0,
“direcao”: 170,
“altitude”: 341
Filtering with Data + ID :
Filter: filter:{“$and”:[ {“dt_evento”:{“$date”:“2016-11-28T23:21:43.0000”}},{“bem_id”: “58338261bab1178e0a393cec”} ]}
This error only happens when the $ and operator is used. Then I will need to do a Between between 2 dates