I have a model that looks like this:
mongoose.Schema({ username: String, posts: [{ type: Schema.Types.ObjectId, ref: \'Post\' }] });
I have
If you want remove one element from an array use this
User .update( {_id: req.user._id}, { $pull: {posts: req.body.post_id } } ) .then( err => { ... });
Here the documentation