Sitecore 8 MongoCommandException using Mongo Db as a service (mLab)

In essence Andy Cohen has already described the solution to overcome the MongoCommandException in one of his blog posts.

However, when I connected to my Mongo database hosted with mLab and attempted to run the db.grantRolesToUser command I got an exception that my user was not authorized on my database to execute the command.

If you experience the same issue the following steps might help you to overcome it:

  1. On your admin database add a new admin user
  2. Use command prompt to login to admin database using the newly created admin user
  3. Switch to your analytics database
  4. Run db.grantRolesToUser command

Leave a Reply

Your email address will not be published. Required fields are marked *