Search code examples
mongodbmongodb-shell

TypeError occurs when trying to enable Mongo DB authentication


I'm on step 3 of trying to enable Mongo DB authentication. When I try to create a user via the Mongo shell exactly as the directions indicate, the shell reports:

TypeError: Property 'createUser' of object admin is not a function

I started mongod with the --auth option and switched to the admin database. as always, help appreciated.


Solution

  • The issue was I was trying to execute this function against mongod 2.4.9 which apparently isn't supported. This error message does not occur in the 2.6.0 release.