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

125
Views
¿Cómo importar una colección existente de MongoDB y realizar la operación?

Estoy tratando de obtener datos de mi colección existente y realizar alguna operación en ella, escuche lo que intenté

 //for getting existing data var Vvin = new mongoose.Schema({}); const VS = mongoose.model('V',Vvin,'vs');

El código anterior funciona, pero ahora viene el problema

 //To perform operation app.get('/get', (req,res) => { VS.find({vWebsite : '123'},(error,result) => { if(error){ res.json(error) }else{ res.json(result); } })

está devolviendo todos los datos sin filtrar vWebsite pero si uso _id funciona correctamente

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pruebe const result = await VS.findOne({vWebsite : '123'}); .

También recuerde hacer que su función sea async .

about 4 years ago · Juan Pablo Isaza 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!