On my Mac,`brew services start mongodb-community@4.2` starts mongod process in unknown port

Share the configuration file and we might help.

Also share the output of

sudo ss -tlp

or

sudo netstat -tlp

The output of the following is also needed:

sudo ps -aef | grep [m]ongo