Permalink
Browse files

Tutorial updates

  • Loading branch information...
1 parent e2d8a51 commit 920b981ff1e24858a8e87bc9981742078d1fb4cd @rozza rozza committed Dec 14, 2012
@@ -59,6 +59,16 @@ class MongoDB(val underlying: com.mongodb.DB) {
*/
def apply(collection: String): MongoCollection = underlying.getCollection(collection).asScala
+ // TODO - write tests and make so!
+ // /**
+ // * Creates a Mongo instance based on a (single) mongodb node (default port).
+ // *
+ // * @param collection a string for the collection name
+ // * @param c (Class[A])
+ // * @return MongoTypedCollection[A]
+ // */
+ // def apply(collection: String, objectClass: Class[DBObject]) = underlying.getCollection(collection).asScala.setObjectClass(objectClass)
+
def addUser(username: String, passwd: String) = underlying.addUser(username, passwd.toArray)
/**
@@ -38,7 +38,7 @@ class CoreWrappersSpec extends CasbahMutableSpecification {
"provide working .asScala methods on the Java version of the objects" in {
- val javaConn = new com.mongodb.Mongo() // Java connection
+ val javaConn = new com.mongodb.MongoClient() // Java connection
"Connection objects" in {
@@ -0,0 +1,2 @@
+.highlight-scala + .highlight-java pre { margin-top: -20px; padding-top: 0px;}
+.highlight-java + .highlight-scala pre { margin-top: -20px; padding-top: 0px;}
Oops, something went wrong.

0 comments on commit 920b981

Please sign in to comment.