When I have such a Schema:
var StudentSchema = new Schema({
_id : Schema.Types.ObjectId,
clazz : { type: String, ref: 'Class' },
number : { type: Number },
name : [{
lang: String,
full : { type: String, trim: true }
}]
});
Each name
would be automatically added an _id
.
I would not use if for any operation my use case, how can I specify in the Schema to drop it?
To my understanding I've to create a Schema to set { _id: false }
, is that your suggested way?
yes
new Schema({..}, { _id: false })
Roger that.
I started out without defining a Schema for the names and that's why I hit the wall.
Most helpful comment
new Schema({..}, { _id: false })