Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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);
Comment

PREVIOUS NEXT
Code Example
Javascript :: raw: true in sequelize 
Javascript :: base64 from file 
Javascript :: javasript object 
Javascript :: deploy node app to heroku 
Javascript :: useeffect cleanup function 
Javascript :: database for javascript 
Javascript :: javascript strings 
Javascript :: polymer js tutorial 
Javascript :: comments in jsx 
Javascript :: pagination in b table in bootstrap vue 
Javascript :: how to use axios filter 
Javascript :: dispatch store 
Javascript :: javascript sleep 1 sec 
Javascript :: hamburger menu js 
Javascript :: nodejs controller 
Javascript :: add to json object javascript 
Javascript :: function statement js 
Javascript :: bind() in javascript 
Javascript :: validate decimal number with 6 decimal digits javascript 
Javascript :: edit message sent by discord.js 
Javascript :: JavaScript slice() Syntax 
Javascript :: add value to object 
Javascript :: what is a closure in javascript 
Javascript :: express request url ignores hash 
Javascript :: query relation data in mongoose 
Javascript :: can we send image in json in angular 
Javascript :: react native gridient button 
Javascript :: javascript escape quotes 
Javascript :: delete single image by using user id in node js mongodb 
Javascript :: js browse file 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =