MongooseServerSelectionError: connect ECONNREFUSED ::1:27017, connect ECONNREFUSED 127.0.0.1:27017
my main file
Can’t connect to MongoClient using Node
i made a simple program to connect to my mongoDB database
enviroment variables file help required
I have Ubuntu OS on AWS free tier.
Ran command: npm install express mongoose dotenv bcryptjs jsonwebtoken cors
Now, in .enf file require below details:
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
Abort transaction friendly way to update multiple documents in mongodb?
Is this a good way to handle multiple updates?
Will abortTransaction work with for Loop?
Mongodb two collection connection with foreign key
I am using HTML, CSS, and JavaScript in the frontend, and Node.js in the backend. For the database, I am using MongoDB. Before adding the authentication page, when random users attempted the quiz, their marks were saved in the MongoDB ‘quizresults’ collection. However, after adding the authentication page, when users successfully registered, their data started saving in the MongoDB ‘user’ collection. But after login, when users submit the quiz, their marks are displayed on the screen, yet the data is not saving in the ‘quizresults’ collection in MongoDB. To resolve this problem, I have attempted to establish a connection between the two collections, ‘users’ and ‘quizresults’, but the problem still persists.