I am executing the following:
db.emails.aggregate(
[
{$addFields : {arr : {$objectToArray : "$$ROOT"}}},
{$project : { pass : {$slice : ["$arr.v", 1, 20 ] }}}
]
).pretty()
When I exit the session / shell, the changes are not saved.
Can someone please direct me on how to apply this modification to the entire collection and save it?