TopicModel mongoose code example
Example 1: mongoose model
const schema = new mongoose.Schema({ name: 'string', size: 'string' });
const Tank = mongoose.model('Tank', schema);
Example 2: schema mongoose
const fruitSchema = new mongoose.Schema ({
name: {
type: String
},
rating: {
type: Number,
min: 1,
max: 10
},
review: String
});