Answers for "how to get data from multiple tables mongoose"

0

how to get data from multiple tables mongoose

const userSchema = new Schema({  
    nick_name:{type:String},  
    email: {  
        type: String,  
        trim: true,  
        required: '{PATH} is required!',
        index: true,
    },
    comments: [{ type: Schema.Types.ObjectId, ref:'Comment' }],
    posts: [{ type: Schema.Types.ObjectId, ref:'Post' }]
}, {timestamps: true});

mongoose.model('User', userSchema);
Posted by: Guest on May-25-2020

Code answers related to "how to get data from multiple tables mongoose"

Code answers related to "Javascript"

Browse Popular Code Answers by Language