MongoDB.live, free & fully virtual. Register Now MongoDB.live, free & fully virtual. Register Now

How to delete the second level of nested data?

Hi @00_00_00,

The uploaded pic has the marked element as an array object therefore you need to use $pull update to remove it.

https://docs.mongodb.com/manual/reference/operator/update/pull/#remove-items-from-an-array-of-documents

db.menus.update({menusName : "333"},{$pull : { children : { menusName : "333" }}})

Best
Pavel