Unable to delete collection

When I am trying to execute this query

mongo “mongodb+srv://cluster0-djhy5.mongodb.net/video” --username m001-student --password m001-mongodb-basics loadReviewsDataset.js

I get the following error.

QUERY [js] uncaught exception: Error: drop failed: {
“ok” : 0,
“errmsg” : “user is not allowed to do action [dropCollection] on [video.reviews]”,
“code” : 8000,
“codeName” : “AtlasError”

I even gave the user “atlasadmin” but still, it doesn’t work.

Hey @jchakrad

So I ran your connection command without the loadReviewsDataset.js file at the end:

mongo "mongodb+srv://cluster0-djhy5.mongodb.net/video" --username m001-student --password m001-mongodb-basics

Then when I was inside the mongo shell I ran


And everything worked! :slight_smile:

Perhaps you could try this out? Just make sure you start the mongo shell from the same directory that has the loadReviewsDataset.js file. And you should be good to go. If not feel free to get back to me.

Also I just tried this command, which is a slight variation to yours but it worked as well. Notice the < character. And if copying the below command be sure to change the fancy quotes to normal quote or the shell will throw a No digits error

mongo “mongodb+srv://cluster0-djhy5.mongodb.net/video” --username m001-student --password m001-mongodb-basics < loadReviewsDataset.js

Hi @natac13

Yes the file is in the same folder where I am running my mongoshell

I have tried the ways you suggested but non of the work it’s still the same issue.

mongo “mongodb+srv://cluster0-djhy5.mongodb.net/video” --username m001-student --password m001-mongodb-basics<loadReviewsDataset.js

MongoDB shell version v4.2.0

connecting to: mongodb://cluster0-shard-00-00-djhy5.mongodb.net:27017,cluster0-shard-00-01-djhy5.mongodb.net:27017,cluster0-shard-00-02-djhy5.mongodb.net:27017/video --username m001-student?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true

2019-08-16T17:46:14.793+0530 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-djhy5.mongodb.net:27017,cluster0-shard-00-01-djhy5.mongodb.net:27017,cluster0-shard-00-02-djhy5.mongodb.net:27017

2019-08-16T17:46:14.793+0530 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-djhy5.mongodb.net:27017

2019-08-16T17:46:14.794+0530 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-djhy5.mongodb.net:27017

2019-08-16T17:46:14.794+0530 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-djhy5.mongodb.net:27017

2019-08-16T17:46:16.384+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] Confirmed replica set for Cluster0-shard-0 is Cluster0-shard-0/cluster0-shard-00-00-djhy5.mongodb.net:27017,cluster0-shard-00-01-djhy5.mongodb.net:27017,cluster0-shard-00-02-djhy5.mongodb.net:27017

Implicit session: session { “id” : UUID(“7ad567f0-af3e-4396-8c1d-62419de4e9d5”) }

MongoDB server version: 4.0.12

WARNING: shell and server versions do not match


2019-08-16T17:46:20.510+0530 E QUERY [js] uncaught exception: Error: drop failed: {

“ok” : 0,

“errmsg” : “user is not allowed to do action [dropCollection] on [video.reviews]”,

“code” : 8000,

“codeName” : “AtlasError”

} :




2019-08-16T17:46:22.259+0530 E QUERY [js] uncaught exception: WriteCommandError({

“ok” : 0,

“errmsg” : “user is not allowed to do action [insert] on [video.reviews]”,

“code” : 8000,

“codeName” : “AtlasError”

}) :


“ok” : 0,

“errmsg” : “user is not allowed to do action [insert] on [video.reviews]”,

“code” : 8000,

“codeName” : “AtlasError”








You are connecting to the wrong database.
Connect to “m001 Sandbox”
I did
mongo “mongodb+srv://sandbox-cv53c.mongodb.net/test” --username m001-student --password m001-mongodb-basics loadReviewsDataset.js

By the way, you’re replying to a post that’s more than 7 months old.