I want to create a partial index in MongoDB which excludes documents that are older than 30 days in the past from the current date.
Something like this (pseudo code):
partialFilterExpression: { date: { $gte: { $currentDate - 30 days }} }
The $currentDate
should be the actual current date, in other words the date is a dynamic value, not a static value.
It this possible?