$pull seems to just set an element to null
<p>I'm trying to setup a delete button where a lesson can be deleted from a class. Using $pull seems to just set lesson_id to null though. Is there a way to remove that element completely?</p>

<pre><code>var classSchema = new Schema({
    title: { type: String, required: true },
    lessons: [{
        _id: false,
        lesson_id: {type: mongoose.Schema.Types.ObjectId, ref: 'Lesson'}
    }]
});

module.exports.deleteLesson = function(class_id, lesson_id, callback){
    Class.update(
        {'_id': class_id}, 
        { $pull: {lessons: {'lesson_id.$._id': lesson_id}}},
        callback
    )
}
</code></pre>

<p>For example </p>

<pre><code>{ _id: 5808,
  title: 'cd',
  __v: 0,
  lessons: [ { lesson_id: [Object] }, { lesson_id: [Object] } ] }
</code></pre>

<p>becomes </p>

<pre><code>{ _id: 5808,
  title: 'cd',
  __v: 0,
  lessons: [ { lesson_id: null }, { lesson_id: [Object] } ] }
</code></pre>