Mongodb – Host server on Heroku
I have been trying to deploy a server for my first MERN app for the past week but I can't seem to get it work. It works perfectly when I host it locally but I can't seem to get the…
I have been trying to deploy a server for my first MERN app for the past week but I can't seem to get it work. It works perfectly when I host it locally but I can't seem to get the…
I'm in a NodeJS server using ExpressJS to handle my /register route. One step in my registration process is to ensure that the user's username and email are both unique, if so, they can register and add their account to…
Im trying to call an API to fetch the data and move it to mongodb from my react application to the node js server but im keep getting that error along with another error in the console. I tried to…
I have a form here with the delete method being used: <form action="/article/<%= articles[i]._id %>" method="DELETE"><button class="btn btn-danger" type="submit">Delete</button></form> Then my routes for the article ID's look like this: const articleById = require('../controllers/article/articleById') router.get('/:id', articleById) const deleteArticleById = require('../controllers/article/deleteArticleById') router.delete('/:id',…
So in my backend (express and mongodb) I have a field inside of post model called picture and it's type is string. So in the frontend (React) I want the user to be able to select a file and then…
I am getting an error after trying to use the POST method through postman to register a user. I have created a simple Schema for the register route. Error: Error in register: Error: User validation failed: password: Cast to string…
const result = student.find(); In mongodb database i require to get 10 documents on every buttion click and next time on click i need to get net 10 documents in mongodb.
I'm creating a MERN stack ecommerce application where I want send all user info along with jwt token but except password I'm ok with token part & I know how to send user but i don't know how to exclude…
I was following an ecommerce website tutorial on Nodejs express (handlebars template). When try to connect to mongo dB (installed on system i.e., port 27017) it shows if(err) console.log ("connection Error"+ err) ^ ReferenceError: err is not defined var db=require('./config/connection');…
I'm trying to get the latest version of mongodb-memory-server working with jest on a node express server. I'm trying to follow the guide in the mongodb-memory-server documentation (https://nodkz.github.io/mongodb-memory-server/docs/guides/integration-examples/test-runners#jest), but it seems to leave blanks and I can't figure out how…