LearnBoost/mongoose — Issue #583: remove() on embedded document: "conflicting mods in update"
Author: secoif
Created: 2011-10-27 11:20:11+00:00
State: open

I have the following code in a controller:

```javascript
exports.destroy = function(req, res) {
Activity.findById(req.params.activity, function(err, activity) {
// this looks like it works, a console.log(activity.comments) shows the item is removed
activity.comments.id(req.params.comment).remove()
// never completes: MongoError: have conflicting mods in update
activity.save(function(err, data) {
if (err) { throw err }
res.send(204)
})
})
}
```

Any ideas what is going on?