You created /data/db as root so it has those permissions. You can change the permissions to your user account, or whatever you have mongo running as.
chown -R username /data/db
or /data
You can also set a group
chown -R username.groupname
The -R does it recursively, so it will affect all the files you’ve created running mongoDB as root already.