Add an import for the necessary implicit
and insert like this:
import com.mongodb.casbah.Imports._
mongoColl.insert(rec)
On your question about not being able to instantiate WriteConcern
, it's because there's a class under com.mongodb
and there's an enum-like object under com.mongodb.casbah
. This will work:
import com.mongodb.casbah.WriteConcern
val wc: com.mongodb.WriteConcern = WriteConcern.Normal