This is my structure of mongodb. I need to add field in 0 object of array. Can some one please help
_id:ObjectId("5c2cdb3cdd03242b5c15965a")
Article:Array
0:Object
name:"dublin"
I tried this but it is not working.
db.myCollection.update({_id:ObjectId("5c2cdb3cdd03242b5c15965a")},{$set:{Article:[{regarding:"nodeDeveloper"}]}})
I need output like this
_id:ObjectId("5c2cdb3cdd03242b5c15965a")
Article:Array
0:Object
name:"dublin"
regarding:"nodeDeveloper"