5
有没有简单的方法将List变成MongoDBList(或BasicDBList)?Scala,Casbah - 如何将List转换为MongoDBList?
有没有简单的方法将List变成MongoDBList(或BasicDBList)?Scala,Casbah - 如何将List转换为MongoDBList?
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"]
提示:总是先阅读源代码。它可以为您的问题提供很多答案,并且会很有用。这可能在第一时间很难,但随后变得越来越自然。
我很欣赏你在阅读资料的提示。但是...我们有StackOverflow。拯救我的每一天。 :) – akauppi 2014-08-28 06:25:25