我正在尝试使用 Casbah 工具包编写将数据写入 MongoDB 的函数:
import com.mongodb.casbah.WriteConcern
import ...
def saveRecord(rec: MongoDBObject) {
mongoColl.insert(rec)
}
我收到以下错误:
1) No implicit view available from Object => com.mongodb.casbah.Imports.DBObject.
2) not enough arguments for method insert: (implicit dbObjView: Object => com.mongodb.casbah.Imports.DBObject, implicit concern: com.mongodb.WriteConcern, implicit encoder: com.mongodb.casbah.Imports.DBEncoder)com.mongodb.casbah.Imports.WriteResult. Unspecified value parameter dbObjView.
怎么了?