Hello! I have a model in my code that includes the following:
ship: {
type: mongoose.Schema.ObjectId,
ref: 'Ship',
required: [true, 'Review must belong to a ship.'],
This attaches a “Ship ID” to individual reviews. While nice, I’m wondering if I can attach a specific field in the Ship model called “shipName”. Is there a way for me to do this? I wasn’t sure if I would use a different “type” in the example code. Any help would be appreciated. Thank you.