Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor bugfixes/enhancements from 1.0 release.

    + Updated externals to link against 2.8.0 final - 1.0 release had some RC/Beta built externals. (scalaj-collection is still linked against Beta)
    + Added an Object interface, MongoDBAddress, for static construction of DBAddress instances.
    + Added type aliases in MongoTypeImports for all Casbah companion objects - please report any odd behavior this causes.
    + Added MapReduceCommand to BaseImports
  • Loading branch information...
commit f164376d19b7876d9afddf203dd596794b7de8c1 1 parent a44a7a5
@bwmcadams bwmcadams authored
View
6 notes/1.0.1.markdown
@@ -0,0 +1,6 @@
+Minor bugfixes/enhancements from 1.0 release.
+
+ + Updated externals to link against 2.8.0 final - 1.0 release had some RC/Beta built externals. (scalaj-collection is still linked against Beta)
+ + Added an Object interface, MongoDBAddress, for static construction of DBAddress instances.
+ + Added type aliases in MongoTypeImports for all Casbah companion objects - please report any odd behavior this causes.
+ + Added MapReduceCommand to BaseImports
View
2  project/build.properties
@@ -3,7 +3,7 @@
project.organization=com.novus
project.name=casbah
sbt.version=0.7.4
-project.version=1.0
+project.version=1.0.1
def.scala.version=2.7.7
build.scala.versions=2.8.0
project.initialize=false
View
4 project/build/CasbahProject.scala
@@ -3,10 +3,10 @@ import sbt._
class CasbahProject(info: ProjectInfo) extends DefaultProject(info) with rsync.RsyncPublishing with posterous.Publish {
override def compileOptions = super.compileOptions ++ Seq(Unchecked, Deprecation)
- val scalaTime = "org.scala-tools" % "time" % "2.8.0.RC6-0.2-SNAPSHOT"
+ val scalaTime = "org.scala-tools" % "time" % "2.8.0-0.2-SNAPSHOT"
val configgy = "net.lag" % "configgy" % "1.5.2"
- val scalatest = "org.scalatest" % "scalatest" % "1.2-for-scala-2.8.0.RC6-SNAPSHOT" % "test"
+ val scalatest = "org.scalatest" % "scalatest" % "1.2-for-scala-2.8.0.final-SNAPSHOT" % "test"
val scalajCollection = "org.scalaj" % "scalaj-collection_2.8.0.Beta1" % "1.0.Beta2"
View
10 src/main/scala/mongodb/Implicits.scala
@@ -260,12 +260,20 @@ trait Imports extends BaseImports with MongoTypeImports with Implicits
trait BaseImports {
val MongoConnection = com.novus.casbah.mongodb.MongoConnection
+ val MongoDBAddress = com.novus.casbah.mongodb.MongoDBAddress
val MongoDBObject = com.novus.casbah.mongodb.MongoDBObject
val GridFS = com.novus.casbah.mongodb.gridfs.GridFS
+ val MapReduceCommand = com.novus.casbah.mongodb.map_reduce.MapReduceCommand
}
trait MongoTypeImports {
-
+ type MongoConnection = com.novus.casbah.mongodb.MongoConnection
+ type MongoCollection = com.novus.casbah.mongodb.MongoCollection
+ type MongoDBObject = com.novus.casbah.mongodb.MongoDBObject
+ type MongoCursor = com.novus.casbah.mongodb.MongoCursor
+ type MapReduceCommand = com.novus.casbah.mongodb.map_reduce.MapReduceCommand
+ type MapReduceResult = com.novus.casbah.mongodb.map_reduce.MapReduceResult
+ type DBAddress = com.mongodb.DBAddress
type DBObject = com.mongodb.DBObject
type BasicDBObject = com.mongodb.BasicDBObject
type BasicDBList = com.mongodb.BasicDBList
View
60 src/main/scala/mongodb/MongoConnection.scala
@@ -71,3 +71,63 @@ class MongoConnection(val underlying: Mongo) {
def getConnectPoint = underlying.getConnectPoint
def getAddress = underlying.getAddress
}
+
+/**
+ *
+ * @author Brendan W. McAdams <bmcadams@novus.com>
+ * @version 1.0, 07/24/10
+ * @since 1.0.1
+ */
+object MongoDBAddress {
+
+ /**
+ * Connects to a given database using the host/port info from an existing
+ * DBAddress instance.
+ *
+ * @param other DBAddress the existing DBAddress
+ * @param dbName String the database to which to connect
+ * @return com.mongodb.DBAddress
+ * @throws java.net.UnknownHostException
+ */
+ def apply(other: DBAddress, dbName: String) = new DBAddress(other, dbName)
+
+ /**
+ * Creates a new DBAddress... acceptable formats:
+ *
+ * <pre>
+ * name ("myDB")
+ * <host>/name ("127.0.0.1/myDB")
+ * <host>:<port>/name ("127.0.0.1:8080/myDB")
+ * </pre>
+ *
+ * @param urlFormat String
+ * @return com.mongodb.DBAddress
+ *
+ * @throws java.net.UnknownHostException
+ *
+ */
+ def apply(urlFormat: String) = new DBAddress(urlFormat)
+
+ /**
+ * Connects to a database with a given name at a given host.
+ *
+ * @param host String
+ * @param dbName String
+ * @return com.mongodb.DBAddress
+ * @throws java.net.UnknownHostException
+ */
+ def apply(host: String, dbName: String) = new DBAddress(host, dbName)
+
+ /**
+ * Connects to a database with a given host, port &amp; name at a given host.
+ *
+ * @param host String
+ * @param port Int
+ * @param dbName String
+ * @return com.mongodb.DBAddress
+ * @throws java.net.UnknownHostException
+ */
+ def apply(host: String, port: Int, dbName: String) =
+ new DBAddress(host, port, dbName)
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.