{ resource: { db: "admin", collection: "system.backup_users" }, actions: [ "find" ] }, { resource: { db: "admin", collection: "system.users" }, actions: [ "find", "remove", { resource: { db: "admin", collection: "system.version" }, actions: [ "find", "update" ] } ], roles: [ ] } ) 

Step 3: Create a user with the new role. Create a user and assign the user the downgradeRole . 

use admin db.createUser( { user: "downgradeAuthUser", pwd: "somePass123", roles: [ { role: "downgradeAuthRole", db: "admin" } ] } ) 

Note: Instead of creating a new user, you can also grant the role to an existing user. See db.grantRolesToUser() method. 

Step 4: Authenticate as the new user. Authenticate as the newly created user. 

use admin db.auth( "downgradeAuthUser", "somePass123" ) 

The method returns 1 upon successful authentication. 

Procedure The following downgrade procedure requires <database>.system.users collections used in ver- sion 2.4. to be intact for non- admin databases. 

Step 1: Connect and authenticate to MongoDB instance. Connect and authenticate to the mongod instance for a single deployment or a mongos for a sharded cluster with the appropriate privileges. See Access Control Prerequisites (page 872) for details. 

Step 2: Create backup of 2.6 admin.system.users collection. Copy all documents in the admin.system.users (page 291) collection to the admin.system.new_users collection: 

db.getSiblingDB("admin").system.users.find().forEach( function (userDoc) { status = db.getSiblingDB("admin").system.new_users.save( userDoc ); if (status.hasWriteError()) { print(status.writeError); } } ); 

## Step 3: Update the version document for the authSchema . 

db.getSiblingDB("admin").system.version.update( { _id: "authSchema" }, { $set: { currentVersion: 2 } } ); 

