Scala, Casbah - How to convert a list to MongoDBList?

Is there an easy way to include List in MongoDBList (or BasicDBList)?

+5
source share
1 answer
scala>  val list = List("foo", "bar")
list: List[java.lang.String] = List(foo, bar)

scala>  val dbList = MongoDBList(list:_*)
dbList: com.mongodb.casbah.commons.MongoDBList = [ "foo" , "bar"]

Hint: read the source code first. He can give a lot of answers to your questions and will be useful BTW. It may be hard for the first time, but then it became more and more natural.

+5
source

All Articles