So I am running the following query.
[{$project: {
location: 1,
day: {
$dayOfMonth: '$timestamp'
},
month: {
$month: '$timestamp'
},
year: {
$year: '$timestamp'
}
}}, {$match: {
month: 3,
year: 2022
}}]
Which returns 1,273,385 documents. Which is a lot however each of these documents are really important to us, and we need to be able to put them on a Google Map as markers.
Anyway as you can see from the image below, the query has no index. How can I index the timestamp aka Date using MongoDB Compass?