Search code examples
databasemongodbcollectionsmern

I can't create a mongodb database. User is not allowed to do action [createCollection]


I'm completely new in databases and I'm trying to learn the MERN stack. I successfully created a cluster, but when I'm trying to create a database in MongoDB Atlas, it's just giving me an error:

user is not allowed to do action [createCollection] on [mydatabase.users]

What should I do? I literraly can't find the solution for this problem.

error


Solution

  • In case anyone facing issue during creating an database / collection

    Simply do this steps :

    • Go to "Database Access" in your atlas tab
    • Scroll down to "Database User Privileges"
    • Click on "Built - in Roles"
      -Now choose "Admin role"