In this article, I will share how to install MongoDB on MacOS Catalina.
First, I created a directory under the Library folder as shown below. /Users/onur/Library/Data/data/db
You can use any path as you want.
Then, I gave read and write privileges to these folders.
chmod -R 777 Data/
Under db folder, I run below commands.
brew tap mongodb/brew brew install mongodb-community brew services start mongodb-community
Then I test mongo command as shown below:
I also run below command to point dbpath to my folder.
sudo mongod --dbpath /Users/onur/Library/Data/data/db
Thanks.
Onur

Onur Baskirt is a Software Engineering Leader with international experience in world-class companies. Now, he is a Software Engineering Lead at Emirates Airlines in Dubai.