Answers for "Mongodb Remove array element by index"

-1

Mongodb Remove array element by index

db.example.update({}, [
     {$set: {field: {
           $concatArrays: [ 
                  {$slice: ["$field", P]}, 
                  {$slice: ["$field", {$add: [1, P]}, {$size: "$field"}]}
           ]
     }}}
]);
Posted by: Guest on May-04-2021

Code answers related to "Mongodb Remove array element by index"

Browse Popular Code Answers by Language