0

I am using mongo-java driver(2.12).Suppose I have multiple databases. Before 2.11 version (we use Mongo class), for authentication I need to create user in each database and then authenticate it using db.auth(). I came to know this can be achieved easily using MongoClient. I am new to mongoDB. Please tell me the benefits of using MongoCredential class.

Thanks in advance...

1 Answers1

0

It lets you encapsulate whatever credentials you're using (mongocr vs gssapi) and pass them around irrespective of the actual implementation.

evanchooly
  • 6,102
  • 1
  • 16
  • 23