skip to Main Content

Mongodb – DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7

I am just making a database called Fruits from my app.js and connecting the database to MongoDB using Mongoose. const mongoose = require("mongoose"); mongoose.connect("mongodb://localhost:27017/fruitsDB", {useNewUrlParser: true}); mongoose.set('strictQuery', false); const fruitSchema = new mongoose.Schema({ name: String, rating: Number, review: String });…

VIEW QUESTION

Update element of an array if and only if data for element is present in new document mongodb

I have a problem while updating an array. sample document : _id:11, marksObtained:[{physics:10}, {chemistry:12}, {maths: 11}, {biology:9}, {social:9}] name:"Someone" field to update is: [{chemistry:13},{zoology:12}] So the new document looks like: _id:11, marksObtained:[{physics:10}, {chemistry:13}, {maths: 11}, {biology:9}, {social:9},{zoology:12}] name:"Someone" marks in…

VIEW QUESTION
Back To Top
Search