skip to Main Content

Can MongoDB update a Mongo Document?

I have below data: [ { "_id": { "$oid": "6459f1020162e7e3649729c9" }, "user_id": { "$oid": "644fd02b7add0a888e2e8e84" }, "creditTotal": 500, "debitTotal": 0, "creditDebitTotal": 500, "userWallet": [ { "userName": "hhjj", "mobileNumber": "6666699888", "sumTotal": 500, "debit": { "totalDebit": 0, "transactions": [] }, "credit": {…

VIEW QUESTION

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