Problem: Access Denied [Solved]

Hi, I have a problem with the file loadMovieDetailsDataset.js , when I try to load it:


(Accesso Negato is Access Denied in Italian);

How may I solve it?

Looks like some access issue
Does the .js file exist?

Directory of C:\Users\ramrt\M001\loadMovieDetailsDataset

01/10/2019 01:56 PM .
01/10/2019 01:56 PM …
01/10/2019 01:56 PM 1,381,666 loadMovieDetailsDataset.js
1 File(s) 1,381,666 bytes
2 Dir(s) 175,918,723,072 bytes free

Once you load should see below message

MongoDB Enterprise Cluster0-shard-0:PRIMARY> load(“loadMovieDetailsDataset.js”)

1 Like

yes, the file exist.

Which DB you are loading?
Make sure you are connected to correct DB
Please paste output of
show dbs

Looks like the permission issue. Make sure:

  • You have the file in the folder
  • You can open the file from your system.
  • Exit the mongo shell and run less loadMovieDetailsDataset.js
  • User m001-student has the permission to Read/Write Databases

If still not able to connect, let me know the command you are using to connect to Mongo Shell.


  1. Check the permission of the user on atlas mongodb cluster. If it has no read/write permission then please give this permission to user.
  2. If in your .js file if this line is missing then add it at the top
    db = db.getSiblingDB(“db_name”);
  3. First go the directory in which your js file conatins then open connection with cluser and then loads

As per my understand by default admin database is active and you have to use other db by using foloowing command and then load() operation.
use dbname;

Thanks a lot! I solved it! I was using the wrong user and I did not notice it.

1 Like