You need to add the parameter port in the configuration file:

“net:
bindIp: 127.0.0.1
port: 27017”
https://www.mongodb.com/docs/manual/reference/configuration-options/#:~:text=net%3A,port%3A%2027017

1 Like