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

115
Views
I have a web application where i need to implement search functionality from Mongo database

I have a web application where i need to implement search functionality on all the data coming from the Mongodb. I need to combine all the collections and implement search on that.

  var db= client.db('bloggingapp');
    var collections = db.listCollections().toArray(function (err, names){
    const coll = Object.keys(mongoose.connection.collections);
      //console.log(coll);
      for(var i=0;i<coll.length;i++){
        //console.log(coll);
      const allData = db.collection(coll[i]).find({}).toArray(function (err, result) {
          if (err) throw err;
          console.log(JSON.stringify(result, null, 2));  
          return result;
       
    });
    }
  })

I have the complete collection of data in the result json but how do i store it to object so that i can implement my search on that json.

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!