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

135
Views
How to import existing collection from MongoDB and Perform operation it?

I am trying to get Data from my existing collection and perform some operation on it, hear what i tried

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

Above code is working but now comes issue

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

it is returning all data without filtering vWebsite but if i use _id it's work properly

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

0

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

Also remember to make your function 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!