Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

128
Vistas
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 Respuestas
Responde la pregunta

0

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

Also remember to make your function async.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda