Permission denied message while running mongo command in shell


I am following the Developer certificate course. From the Chapter 2, I followed the video to install mongo shell. When I attempt to check the version, I get the version though, but also I get below error message. Can you help to eliminate this command. I did check with sudo command. but with no luck.

"mongo --nodb

MongoDB shell version v4.0.5

2019-01-11T05:41:41.406+0530 I STORAGE [main] In File::open(), ::open for ‘/Users/XXXX/.mongorc.js’ failed with Permission denied

The “.mongorc.js” file located in your home folder could not be executed"

Please check my reply on your other thread.


Thanks ‘kanikasingla’ for the response.

I have given full permissions for /.mongorc.js and also for .dbshell file.
Only then I could get version correct and could able to connec to the cluster.