Aquasar
  • Home
  • Portfolio
  • Articles
  • Pricing
  • About
  • Contact
WEB DEVELOPMENT |SEO |DIGITAL ADS

Using Virtual Populate instead of Child Embedding

Oct 7th, 2019

Alana Ma

mongo

An example of using Virtual populate in our tour model

// Virtual Populate
TourSchema.virtual('reviews', {
  ref: 'Review',
  foreignField: 'tour',
  localField: '_id'
})