Doc:
{
_id: 5150a1199fac0e6910000002,
name: \'some name,
items: [{
id: 23,
name: \'item name 23\'
},{
id: 24,
name: \'ite
Kishore Diyyana:
If you want to remove all elements including key of the element attributes list. Here is the example of mongoDB unset operator:
db.UM_PREAUTH_CASE.update( { 'Id' : 123}, { $unset: { dataElements: ""} } )
JSON Look like this:
{ "Id":123,"dataElements" : [ { "createdBy" : "Kishore Babu Diyyana", "createdByUserId" : 2020 }, { "createdBy" : "Diyyana Kishore", "createdByUserId" : 2021 } ] }