I have model,virtual in it ref to User model. How to get user name without calling User model also tour.who print multiple users from diff tour.
//console.log(user);print multiple user instead of specific to trip.
var TourSchema = new Schema({ user:{ type: Schema.ObjectId, ref: 'User' }, tour:String, tour_slug:String, date:{type:Date, default: Date.now}, tour_date:Date, }); TourSchema .virtual("who") .get(function(){ User.findOne({'fb._id':this.user,function(err,user){ if(err)console.log(err); else //console.log(user); return user.full; }); });