MongoDB recommends to use the most complete version of MongoDB Server, in order to do this, we will download MongoDB Enterprise. Download the package for your SO in TGZ format.
$ tar -xvzf [name-of-the-file.tgz]
$ cd [name-of-the-folder]/bin
$ sudo bash
$ cp * /usr/local/bin
$ exit
With macOS Catalina, you can no longer store files or data in the read-only system volume, nor can you write to the "root" directory ( / ) from the command line, such as with Terminal. Read more...
$ sudo bash
$ mkdir -p /data/db
$ chmod 777 /data
$ chmod 777 /data/db
$ exit
$ sudo bash
$ mkdir -p ~/data/db
$ chmod 777 ~/data
$ chmod 777 ~/data/db
$ exit
$ touch /usr/local/etc/mongod.conf
Write this on the same mongod.conf file
storage:
dbPath: /Users/youruser/data/db
We need to modify our .zshrc
file, adding:
alias mongod='mongod -f /usr/local/etc/mongod.conf'
By Diego Vázquez