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

156
Views
Cómo hacer que el usuario use forEach loop Mongoose

Tengo una serie de identificaciones parece

 get profiles [ '62d80ece61a85d738fa0c297', '62d80fb061a85d738fa0c29c' ]

Quiero hacer un bucle en esta matriz y que cada índice la use en el método find () Mi código se ve así

 let total = []; profile.forEach(async (index) => { console.log('index', index); //OUtput of the console of index //index 62d80ece61a85d738fa0c297 //index 62d80fb061a85d738fa0c29c let user = await this.userModel.findOne({ _id: index }); total.push(user); console.log('Service', total); //Output of service is Service []

Gracias por adelantado

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Sin ninguna información sobre el esquema, una solución que puedo proponer es convertir explícitamente la cadena a ObjectId

about 4 years ago · Santiago Gelvez Report
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!