Casbah version: 2.8.0
Following example here: http://api.mongodb.com/scala/casbah/2.0/tutorial.html#combining-multiple-dbobjects
I'm using below as import statements.
import com.mongodb.casbah.AggregationOutput
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.TypeImports._
import com.mongodb.casbah.commons.{MongoDBList, MongoDBObject}
And below ++ got Cannot resolve symbol ++ error.
val basic = MongoDBObject(
"id" -> "123",
"project" -> "pp123"
)
val createdTime = MongoDBObject(
"createdTime" -> MongoDBObject(
"$exists" -> false
)
)
val query = basic ++ createdTime
I tried to Google but didn't find much, the official documentation didn't help either...
I guess I'm just missing an import statement for ++, but I don't know which one to import.
A quick grep of the source reveals two
++methods on theMongoDBObjectclass:The second one looks relevant here.
<%denotes a view bound, so you need an implicit conversion fromMongoDBObjecttoDBObject.It looks like you can import
com.mongodb.casbah.Implicits._to get this.