Hello : )
see
The bellow code,says take the elements from [ 0 , size(array)-3]
I didn’t run it i hope will be ok.The bellow is database command,you can take the pipeline
and use it in aggregation or update.
If you want any range,like remove 5 6 7 10 12 indexes,you can reduce the array,and keep only the wanted members.
{
"aggregate": "testcoll",
"pipeline": [
{
"$addFields": {
"array1": {
"$slice": [
"$array1",
{
"$subtract": [
{
"$size": "$array1"
},
3
]
}
]
}
}
}
],
"maxTimeMS": 300000,
"cursor": {}
}