skip to Main Content

How to find specific object from array in MongoDB

Suppose I have this MongoDB document: { "_id": { "$oid": "628f739398580cae9c21b44f" }, "place":"Amsterdam", "events": [ { "eventName": "Event one", "eventText": "Event", "eventDate": "010101" "host":"Bob" }, { "eventName": "E2", "eventText": "e2", "eventDate": "020202" "host":"John" } ] } { "_id": { "$oid":…

VIEW QUESTION

Having issue with aggregation in MongoDB

I'm using MongoDb with Node.js. And I'm having trouble with aggregation.This is the Example of data in Collection in Database: { "name": "abcdef", "address": ghijk, "reli":"A", "prov:"a" , } { "name": "xyz", "address": "vwz", "reli":"B", "prov:"b" , } { "name":…

VIEW QUESTION

Mongodb – nodemon app crashed – waiting for file changes before starting can you help me?

my code is; ` router.post("/login", async (req, res)=>{ try { const user = await User.findOne({ email: req.body.email }); !user && res.status(401).json("Wrong password or username !"); const bytes = CryptoJS.AES.decrypt(user.password, process.env.SECRET_KEY); const originalPassword= bytes.toString(CryptoJS.enc.Utf8); originalPassword !== req.body.password && res.status(401).json('Wrong Password or…

VIEW QUESTION
Back To Top
Search