Cannot run raw queries on Atlas using admin

Hi All,

Good day!.Trying to run some queries on the IDE’s provided at the end of each chapter in mongo db001 basics course,errors out throwing an atlas error with the following message:
Cannot run raw queries on Atlas using admin…Any leads to overcome this issue would be of great help.

Please include screenshot of the error on the IDE, and your connection string.

Assuming your error is

MongoError: cannot do raw queries on admin in atlas.

Then are you probably running a connection string like this:

mongodb+srv://details/admin

Which, from all the databases, it access on admin.

But you can’t run raw query on admin.

Either use a database

use <dbname>

or connect using

mongodb+srv://details/<dbname>
1 Like

That helped.Thanks!!