MongoDB scala – CASBAH

Playing with scala/mongodb for fun. The docs for mongodb suggest that adding

val casbah = "com.novus" % "casbah_2.8.0" % "1.0.8.5"

to the build project should be enough to get casbah included in the current project. I get no end of errors when I attempt to use this. I used a popular web search tool to find that

val bumRels = "bum-releases" at "http://repo.bumnetworks.com/releases" 
val bumSnaps = "bum-snapshots" at "http://repo.bumnetworks.com/snapshots" 
val casbah = "com.novus" % "casbah_2.8.0" % "1.0.8.1"	

allows sbt to pull casbah in. I haven’t actually tried doing anything with it yet – mainly because I keep running back to the safe world of python or playing in the shell.

Advertisements

2 comments

  1. It turns out that the config.scala file you need to use as your projects is a little more intricate. I needed to set up repositories, and such. I’ve posted it below in hopes that it’s interesting…

    import sbt._
    
    class HelloWorldProject(info: ProjectInfo) extends DefaultProject(info)
    {
      lazy val hi = task { println("Hello World"); None }
      override def mainScalaSourcePath = "src"
      override def mainResourcesPath = "resources"
            
      override def testScalaSourcePath = "test-src"
      override def testResourcesPath = "test-resources"
      val bumRels = "bum-releases" at "http://repo.bumnetworks.com/releases"
      val bumSnaps = "bum-snapshots" at "http://repo.bumnetworks.com/snapshots" 
       val vsd = "org.scala-tools" % "vscaladoc" % "1.1" 
    
      val casbah = "com.novus" % "casbah_2.8.0" % "1.0.8.5"
    
    //  val lift_mongo = "net.liftweb" % "lift-mongodb_2.8.0" % "2.1"
    //  val lift_mongo_record = "net.liftweb" % "lift-mongodb-record_2.8.0" % "2.1"
    }
    
    1. Hi Henry,

      I just tried SBT with scala 2.7.7 and got the notice about missing vscaladoc, I don’t recall seeing this the first time I tried (using 2.8.0RC1).

      Thanks

      
      import sbt._ 
       
      class Foo(info: ProjectInfo) extends DefaultProject(info) { 
      	val scalaToolsSnapshots = ScalaToolsSnapshots
      	val scalatest = "org.scalatest" % "scalatest" % "1.0.1-for-scala-2.8.0.RC1-SNAPSHOT"
      
          // CASBAH
          val bumRels = "bum-releases" at "http://repo.bumnetworks.com/releases"
          val bumSnaps = "bum-snapshots" at "http://repo.bumnetworks.com/snapshots"
          //val casbah = "com.novus" % "casbah_2.8.0" % "1.0.8.1"
          val vsd = "org.scala-tools" % "vscaladoc" % "1.1" 
          val casbah = "com.novus" % "casbah_2.8.0" % "1.0.8.5"
        
      }
      

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s