Skip to content
Advertisement

Tag: mongodb

meteor How to use upsert | Exception while simulating the effect of invoking ” TypeError: Cannot read properties of undefined (reading ‘_id’) react.js

I’m having trouble with upsert with meteor.js. I could update questions finely with the below codes but I won’t be able to insert new data. file in client side file in server side (collection file) Got error saying… Exception while simulating the effect of invoking ‘modifyQuestion’ TypeError: Cannot read properties of undefined (reading ‘_id’) I thought when {_id: questionId._id} got

MongoDB match expression query not working

MongoDb query match expression not working. I have a posts collection and want to return only those posts which match the user Id of the user who created it but my query does not seem to be working. Sample Dataset MongoDb Query:- Query Output:- The query does not work output contains posts created by all users it is not filtering.

How to return sorted array from object from MongoDB document?

I want to return an array, which is a property inside my mongo model/document, and I want that array to be sorted. My MongoDB document looks like: And I’m trying to return: I have tried aggregation: Answer Mongo Playground reference Since $unwind returns the arrays as objects, we are using the $group to push the objects back into the items

why req.body.title shows ‘undefined’

I’m new to NODE JS and practicing with some POST forms from PUG to a NODE JS server. I have a simple form to update a photo title and description posted onto mongodb. When I submit the form from the web browser the submission input comes back to the server as ‘undefined’. These two processes in POST log ‘undefined’: (see

Advertisement