Add the following XML content to the plist file. Replace /usr/local/bin/mongod
with the correct path to your MongoDB executable if it's different. You may also need to adjust other settings like the data directory or log paths.
Launch Terminal. Create this new file:
nano ~/Library/LaunchAgents/com.mongodb.mongod.plist
Paste the following: