MongoError: user is not allowed to do action [listIndexes] on [DB.$cmd]

后端 未结 2 692
闹比i
闹比i 2021-01-20 04:25

My API code is using the latest Mongoose 5.0.11 with the proper Mongo 3.4 connection string to connect to the free Atlas service.

mongodb://someadmin:

相关标签:
2条回答
  • 2021-01-20 05:06

    Seems that the user has no permission to listIndexes As per the documentation

    Required Access The user executing the command requires either find privileges on the system.indexes collection or the listIndexes privilege action. At a minimum, the read built-in role provide the requisite permissions.

    0 讨论(0)
  • 2021-01-20 05:10

    I accidentally removed the username from the connection string, so it only had password where it should be username:password which causes this error on any database.

    0 讨论(0)
提交回复
热议问题