I want to setup a cached query of MongoDB so that I can use a Query Result to analyze the data in different ways.
My MongoDB is way too large for this so I want to setup an automatic refresh to grab only the last 30 days prior to today.
{
"collection": "EventTrack",
"aggregate": [
{
"$match": {
"$and": [
{
"EventType": "Click"
},{
"AssemblyId": {
"$gt": 0
}
},{
"EntryDate":{
"$gte": {
"$humanTime": "new Date((new Date().getTime() - (30 * 24 * 60 * 60 * 1000)))"
}
}
}
]
}
}
How do I achieve this?