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

259
Views
Obtenga datos de mangosta con llamadas de mangosta anidadas en el nodo js

Quiero obtener todas las revisiones relacionadas con las fiestas y tengo el siguiente código, luego cómo fusionar dos colecciones en una sola colección y convertirlas en un archivo ejs.


PartySchema:


 var partySchema = mongoose.Schema({ user_id: String, category: { type: String, ref: 'categories' }, reviews: [{ type: String, ref: 'reviews' }], title: String, description: String, location: String, latitude: String, longitude: String, contact_no: Number, price: Number, email: String, website: String, video_url: String, facebook_url: String, twitter_url: String, youtube_url: String, pinterest_url: String, images: [{}], startdate: String, enddate: String, starttime: String, endtime: String, price: Number, duration: Number });

Esquema de revisión:


 var reviewSchema = mongoose.Schema({ user : { type: String, ref: 'users' }, party : { type: String, ref: 'parties' }, title: String, content: String });

Ruta.js


 app.get("/admin/ManageParties",isLoggedIn, function (req, res) { Party.find({}).populate('category').populate('reviews') .exec(function(err,_parties){ for(var i in _parties){ Review.find({party:_parties[i]._id},function(err,_rev){ console.log(_rev); }) } res.render('admin/manageparties',{ _p:_parties }) }) });
over 4 years ago · Santiago Trujillo
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!