Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda