Skip to content

Instantly share code, notes, and snippets.

@oreillyross
Created June 30, 2015 11:05
Show Gist options
  • Save oreillyross/00542d41e2adfe34c98b to your computer and use it in GitHub Desktop.
Save oreillyross/00542d41e2adfe34c98b to your computer and use it in GitHub Desktop.
This object helps to simplify the interactions with a MongoDB database.
import com.mongodb.casbah.MongoCollection
import com.mongodb.casbah.MongoConnection
object MongoFactory {
private val SERVER = "localhost"
private val PORT = 27017
private val DATABASE = "portfolio"
private val COLLECTION = "stocks"
val connection = MongoConnection(SERVER)
val collection = connection(DATABASE)(COLLECTION)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment