Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video #36: Connecting to MongoDB #24

Open
yousafa1 opened this issue Apr 9, 2019 · 5 comments
Open

Video #36: Connecting to MongoDB #24

yousafa1 opened this issue Apr 9, 2019 · 5 comments

Comments

@yousafa1
Copy link

yousafa1 commented Apr 9, 2019

Following along to the video tutorial, I'm having an issue connecting to the database. I'm not sure if this is because of mlab migrating over to mongodb?

@LiviuSosu
Copy link

@yousafa1, I guess that the mongoose got deprecated. This might be a cause. You need to add an extra parameter as it is shown bellow:
mongoose.connect('mongodb://tutorial_user:[email protected]:23063/tutorial', {useNewUrlParser: true});

You may check the complete code here: https://github.com/LiviuSosu/ToDoList-TheNetNinja

@yousafa1
Copy link
Author

I look up the code you have and followed it, put my user and password as well. I'm still receiving an error.

The message I receive in the console is:

(node:8049) UnhandledPromiseRejectionWarning: true
(node:8049) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8049) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@yousafa1
Copy link
Author

yousafa1 commented May 2, 2019

WOW. I have a Mac and had to download brew for the error message to go away.

@yousafa1
Copy link
Author

yousafa1 commented May 2, 2019

BUT, I'm having an issue connecting to port 27017. Do you know how to resolve this? I want whatever I add to the todo, to be saved into the database.

On my terminal, I write:
curl portquiz.net:27017
and I receive the message:
curl: (7) Failed to connect to portquiz.net port 27017: Operation timed out

@Josh-Uvi
Copy link

@yousafa1 do you have MongoDB server installed on your mac?
If no, here's a link to install it locally on your Mac.
If yes, check the port number that the MongoDB server is running on your mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants