I have a collection name dbapp in my mongodb. There is a document as follows,I want to remove on widget object inside widgets.I am troubling to create mongodb command script for that.Apprciate your help.thanks
db.dbapp.insert(
{
"tenantid": 16,
"id": 0,
"default": true,
"widgets": [
{
"_id": new ObjectId(),
"position": 1,
"type": 1,
"class": "green",
"metricid": 5
},
{
"_id": new ObjectId(),
"position": 2,
"type": 1,
"class": "blue",
"metricid": 6
},
{
"_id": new ObjectId(),
"position": 3,
"type": 2,
"class": "normal",
"metricid": 1
},
{
"_id": new ObjectId(),
"position": 4,
"type": 2,
"class": "normal",
"metricid": 2
},
{
"_id": new ObjectId(),
"position": 5,
"type": 2,
"class": "normal",
"metricid": 3
}
],
"settings": {
"appid": 0,
"appname": "default"
}
});