I understand how to build a schema, but I not sure how to build one for a project i am working on now. I need to build a schema for haikus, I am not sure the best way to but i was thinking something along these lines:
const PoemsSchema = new Schema({
user: {
type: Schema.Types.ObjectId,
ref: 'users'
},
text:{
type:String,
max: 5,
required: true
},
text: {
type: String,
max: 7,
required: true
},
text: {
type: String,
max: 5,
required: true
}
});
module.exports = mongoose.model('poems', PoemsSchema);
any advice would be great