Permalink
Browse files

update changelog and readme

  • Loading branch information...
1 parent 409286b commit f76f97bd9ced9742c299121f28672e65dcbdfcea @poiati committed Jan 26, 2014
Showing with 19 additions and 1 deletion.
  1. +4 −0 CHANGELOG.txt
  2. +15 −1 README.md
View
@@ -1,3 +1,7 @@
+* 1.3
+ - Support to mongo auth
+ - Now using Groovy 2.2.1.
+ - Now using mongo-java-driver version 2.11.3
* 1.2
- Fixed a race condition Bug
- Now using Groovy 2.1.3
View
@@ -13,7 +13,21 @@ com.gmongo.GMongo doesn't extends com.mongodb.Mongo. It delegate all methods cal
you need to get the Mongo reference just call com.gmongo.GMongo#getMongo.
You can also use `com.gmongo.GMongoClient`. It has the same constructors
-as `com.mongodb.MongoClient`
+as `com.mongodb.MongoClient`. For example, to connect to a MongoDB instance with auth enabled.
+
+```groovy
+@Grab(group='com.gmongo', module='gmongo', version='1.3')
+
+import com.gmongo.GMongoClient
+import com.mongodb.MongoCredential
+import com.mongodb.ServerAddress
+
+credentials = MongoCredential.createMongoCRCredential('username', 'database', 'password' as char[])
+
+client = new GMongoClient(new ServerAddress(), [credentials])
+```
+
+Auth is only available in GMongo 1.3 and above.
Sample:

0 comments on commit f76f97b

Please sign in to comment.