I’m totally new to node/mongodb… I’m trying to retrieve data for my react app using Mongoose on Mac OS Catalina. Running mongod --version
gives me 6.0.1
. I have MongoDB running (I ran brew services start mongodb-community
and my server consoles out Database connected: mongodb://localhost:27017/wheelPuzzles
) but when I try to hit my GET endpoint using axios both in browser and Postman, I get:
It looks like you are trying to access MongoDB over HTTP on the native driver port
.
I’ve been searching for 2 days now and cannot figure out why I’m getting this error. What am I missing please? Can anyone help? Thanks!
This is my error log, in case that helps:
{"t":{"$date":"2022-11-06T16:41:17.247-05:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"[::1]:59904","uuid":"02520f8e-5a07-43b0-bfb2-64c48b07359a","connectionId":3,"connectionCount":1}}
{"t":{"$date":"2022-11-06T16:41:17.248-05:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn3","msg":"Connection ended","attr":{"remote":"[::1]:59904","uuid":"02520f8e-5a07-43b0-bfb2-64c48b07359a","connectionId":3,"connectionCount":0}}
{"t":{"$date":"2022-11-06T16:41:17.248-05:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"[::1]:59905","uuid":"03a595a8-c6b8-4f9d-b3e9-9dbc2987c4f2","connectionId":4,"connectionCount":1}}
{"t":{"$date":"2022-11-06T16:41:17.249-05:00"},"s":"I", "c":"NETWORK", "id":22988, "ctx":"conn4","msg":"Error receiving request from client. Ending connection from remote","attr":{"error":{"code":17,"codeName":"ProtocolError","errmsg":"Client sent an HTTP request over a native MongoDB connection"},"remote":"[::1]:59905","connectionId":4}}
{"t":{"$date":"2022-11-06T16:41:17.249-05:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn4","msg":"Connection ended","attr":{"remote":"[::1]:59905","uuid":"03a595a8-c6b8-4f9d-b3e9-9dbc2987c4f2","connectionId":4,"connectionCount":0}}