1

I'm trying to stop an _id from being added when I push a lesson to the lessons array. It doesn't seem to be working however. Am I not setting the Schema correctly?

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

0 Answers0