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

345
Vistas
Option "useFindAndModify" is not supported

I'm trying to connect to my database using mongoose and in my console is displaying ' option usefindandmodify is not supproted '. I'm using mongoose 6.0.0

this is my code

  mongoose.connect(constants.CONNECTION_URL,
     { useNewUrlParser: true,
       useUnifiedTopology: true, 
       useFindAndModify: false 
     })
.then(() => app.listen(constants.PORT, () => console.log(`Server Running on Port ${constants.PORT}`)))
.catch((error) => console.log(error.message));

mongoose.Promise = global.Promise;

can someone suggest me how can I get rid of that? is written with white if matters neither green nor red, white.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Starting with Mongoose version 6, you should not specify that as an option. It will be handled automatically.

This issue is explained here.

useNewUrlParser, useUnifiedTopology, useFindAndModify, and useCreateIndex are no longer supported options. Mongoose 6 always behaves as if useNewUrlParser, useUnifiedTopology, and useCreateIndex are true, and useFindAndModify is false. Please remove these options from your code.

over 4 years ago · Santiago Trujillo Denunciar

0

i got this error too , so i fixed that like this
i guess useNewUrlParser, useUnifiedTopology, useFindAndModify are no longer available

mongoose.connect(constants.CONNECTION_URL).then(() => app.listen(constants.PORT, () => console.log(`Server Running on Port ${constants.PORT}`)))
.catch((error) => console.log(error.message));

mongoose.Promise = global.Promise;

mongoose.connect(CONNECTION_URL) .then(() => app.listen(PORT, () => console.log(Server running on port ${PORT})) ).catch((error) => console.log(error.message));
over 4 years ago · Santiago Trujillo Denunciar

0

New version of Mongoose don't support useFindAndModify, you don't have to write it in your code, Mongoose by default takes useFindAndModify as false.

just remove useFindAndModify from your code.

over 4 years ago · Santiago Trujillo 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