MongoDB and Mongoose - Create a Model help me

const Schema = mongoose.Schema;
const personSchema = new Schema({
name:{type:String,required:true},
age: Number,
favoriteFoods:[String]

});
const Person = mongoose.model(‘Person’, personSchema);

I am a new in mongoose I confused in this problem Please somebody help me

And what is problem? it’s look o.k.
did you have var mongoose = require(‘mongoose’);
http://mongoosejs.com/docs/guide.html
http://mongoosejs.com/docs/schematypes.html

hi,

if you want declare “favoriteFoods” like an array:

favoriteFoods:[]