How to create document using a specific attribute in reference on mongoose?
Have a user and roles collection, like as:
How to update multiple array of object fields in the most efficient manner using mongoose
Let’s say I have the following data document in Mongo:
replace id with _id with toObject in mongoose node.js gets wrong
I am using mongoose and node.js, here is a simple schema
What to do when my Terminal is stuck at node app.js after connecting it to MongoDB?
I have connected my app.js using a MongoDB driver, but when I try to run node app.js
command it does not print Connected successfully to the server to the console.
How to watch for changes to some fields in MongoDB change streams?
I’m using Mongoose and MongoDB and Nodejs and I want to listen for changes to some fields and also if there is insert operations in a MongoDB collection.
How to add cloudinary url to mongoose?
i added image property to mongoose schema and when i upload an image to cloudinary, i want to add cloudinary secure_url
in db.
Is Possible Mongodb Transaction progress without Replica Set?
I’m working on a small project and I’ve chosen MongoDB as the database. However, I’m experiencing some regrets. I’ve learned that a replica set is required for transaction operations. I’m working on a VPS and I don’t want to create a Docker just for transactions. My Node.js application is using MongoDB version 7.0. Is there a way to use transactions in a Cluster > Standalone setup?
Mongoose populate with array does not work
Hey so I am trying to populate meeting with trainee.name, which does not work and gets to the catch in the try catch block and returns 500. (using fastify+mongoose)
How to model MongoDB database for content only available to authorized users
Problem I’m trying to code a website that sells courses. It uses MongoDB. I have three collections of documents for each course: Course, Chapter, Lecture. Each course has n chapters and each chapter has m lectures. I also have users that can have a premium status based on if they are paying for a subscription. […]
Mongoose CastErrror when pushing to an array field
In my application, I have a User model which contains the fields requests
and followers
, which both store an array of ObjectIds.