Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

296
Views
How to populate the object of id that is present inside an array using mongoose population method?
replies: Array
>0: Object
   _id: ObjectID('6295cefdfab3e2399813bb0c') 
   userID: ObjectID('624eb07040613618bc358d0d')
   reply: "hie"

Now i have to populate userID from an array showing its firstName and email and my code is this which isn't working

.populate("replies.userID", "firstName email ")
    .populate("userID", "firstName email")
    .exec((err, result) => {
      if(err)
      console.log('nothing is shown',err)
    })
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!