LOL I fixed this whole issue really simply. Thanks for the help everyone but I wasn’t thinking about ‘keeping it simple, stupid’
my issue was that mongodb was running fine on my PC (as localhost) and all attempts to do the same on my MAC laptop (m1 chip) were failing.
I realised that the simplest thing to do since my PC install was working fine was as follows:
- give the PC a static IP address by telling my home network router to always assign the same IP address
- make sure the mongod.cfg file was set up correctly (binding to 0.0.0.0 - accepting access from all IP addresses) and security authorisation was enabled
- change the IP address in my mongoose connection string from 127.0.0.1 to the new static IP address that my PC has on the network e.g. 192.0.1.92
Now the PC and the MAC can both access the same mongodb instance using the same code to connect to the newly shared mongodb server on the PC. This is clearly the best solution. I’m sorry I did not learn what was up with the mongodb install on the m1 processor Mac laptop - I would have liked to help the community but I have little understanding of the errors it was chucking.
thanks to everyone who answered my original post. here is a link to the video I used to set up this solution, hopefully it will be helpful to someone else.
2 Likes