In mongoose, can I define a subdocument called groups with a custom _id as follows:
All my ids are Strings.
var UserSchema = new Schema({
_id: { type: String },
firstName: { type: String, trim: true, required: true },
lastName: { type: String, trim: true, required: true },
groups: [ {type: String, ref: 'Group'} ]
});
or should I have to explicitly code the _id like so:
groups: [ { _id: {type: String, ref: 'Group'} } ]