Can not install mongodb on macOS ventura

I used Homebrew to install mongodb and I am getting this error

sudo mkdir -p /data/db
mkdir: /data: Read-only file system

Access to root folder is removed in some Macos flavors
Check this link.You have to use another directory for dbpath where mongod can write like your home dir