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
Back To Top
Search