Skip to content

Instantly share code, notes, and snippets.

@yamakk
Created October 15, 2011 11:45
Show Gist options
  • Save yamakk/1289455 to your computer and use it in GitHub Desktop.
Save yamakk/1289455 to your computer and use it in GitHub Desktop.
MongoDBにScalaで接続
import com.novus.casbah.mongodb
val con = mongodb.MongoConnection() // localhost に接続
val db = con("test")
val col = db("scala")
val item = mongodb.MongoDBObject("name"->"testtest", "age"->23)
col += item
println(col.find().toList)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment