Has anyone running the React course ran into this error when trying to connect to the MongoDB database. “It looks like you are trying to access MongoDB over HTTP on the native driver port.”
If so, do you know how to get around it. I’ve tried running MongoDB using the version Mosh was using in his videos, as well as the latest. Yet both end with the same result. I’ve even tried puttin it on a different port. But alas nothing has worked. This is my current path for the database http://127.0.0.1:27017/api/movies.
Hi,
Why are you trying to reach Mongo via HTTP ?
It seems to me that port is not meant to be used with the HTTP protocol.
You need to install MongoDbCompass to manage it.
I just checked my notes and we did not code the back-end for React course. Instead we took some resulting code from the node.js course.
I did not take it so I won’t be able to help much about the back-end on the course.
You shall download that content to run as back-end and focus on React front-end.
1 Like
Mosh mentioned that you could go to the browser and see the returned json of your current tables. I was not able to do this using the link above. Though I’ve recently found that mongo have gotten rid of that support and yeah I’m using mongo compass . I’ve managed to get the connection working now from the frontend to the backend. At the the of writing, it just wasn’t connecting and I thought the error from the http was an indication as to why.
1 Like
Ok I will try that.
And this is what I’ve got.
Just like you. Tried HTTPS which simply does not work.
Access a service via the browser is just a trial move. It may work because many services implement a web service but here you are given a clear message telling this is not how you use it.
You simply cannot do that.
P.S : As many often mention Mosh courses are not up to date. So technology goes on. This may be a sad thing but no matter what we have to deal with it.
I have a personal project I did leave behind for a few months and after updating I went in issues in routing, the package has changed their way of doing. We either find on our own, either ask the community and someone would likely know. Anyway you did a good move searching why it happened.
1 Like
Sounds about right that it is definitely something you can’t do. Thanks for clearing that one up. I thought I had missed some setting or what not. It’s just me being daft instead
Don’t talk like that. We’re all daft from some point of view. You’re learning, you may have no habits yet or doubts.
No problem. Simply ask if needed. If someone knows or have an idea it will be shared.
1 Like
Haha sorry mate. British humor. I wasn’t putting myself down. More just making a joke about it
Sorry I must be autistic. I often take sentence first degree and don’t get many jokes. But I understand humour… sometimes.
1 Like
Haha don’t worry. Let’s face it jokes and sarcasm are hard to read in text . I’m the same