When filtering an array, is it possible:
filter by item index (e.g. get all array elements but the first)?
filter by value in another field within the same document that contains the array field?
Consider document:
{
_id: 1,
first_seen_on: 20160312,
seen_on: [20160312, 20160313, 20160324]
}
I need the seen_on array to become [20160313, 20160324]
This doesn't seem to work (I think $first_seen_on is treated as literal value):
'repeats': {
'$filter': {
'input': '$seen_on',
'as': 'date',
'cond': {'$ne': ['$date', '$first_seen_on']}
}