1
我的用戶模式是貓鼬拉嵌套數組
{
widgets: [
{
commands: [
{
name: 'delete'
}
]
}
],
name: 'John',
}
,我想通過ID刪除widgets.commands。我用貓鼬。我知道這個id,但是當我提出pull請求時,它不會刪除它。 $pull: {widgets.$.commands: {_id: req.params.id}}
有什麼建議嗎?