本文介绍了Scb,Casbah-如何将List转换为MongoDBList?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种简单的方法可以将List转换为MongoDBList(或BasicDBList)?
Is there an easy way to turn List into MongoDBList(or BasicDBList) ?
推荐答案
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: always read source code at first. It can provide many answers to your questions and will be useful BTW. It may be hard at first time, but then it became more and more natural.
这篇关于Scb,Casbah-如何将List转换为MongoDBList?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!