skip to Main Content

Mongodb – MongooseError: Model.findOne() no longer accepts a callback in backend log

import express from"express" import cors from "cors" import mongoose from "mongoose" import bodyParser from'body-parser' // const {Schema} = mongoose; const app = express() app.use(bodyParser.json()) app.use(bodyParser.urlencoded({extended: true})) app.use(cors()) await mongoose.connect('mongodb://127.0.0.1:27017/loginRegisterDB',{ useNewUrlParser: true, useUnifiedTopology: true },) .then(() => console.log( "connected")) .catch((err) =>…

VIEW QUESTION

How to hide node.js warning when running Docker?

When I build my image, and run, I kept getting this message ❌❌❌ (node:26) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option. (Use node --trace-deprecation ... to show where the warning was created) (node:26) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware'…

VIEW QUESTION
Back To Top
Search