Remove last item(s) from array after push new

273 Views Asked by At

For example i have some Collection with array of actions

e.g. i push item(s) to actions array, so can i somehow set limit of element's in array(in schema) or delete items out of lenth in one query(i push new actions to the start)

don't need validate and throw error, just delete items out of range

$push: {
  action: {
    $each: [_newAction],
    $position: 0
  }
}
0

There are 0 best solutions below