简体   繁体   中英

MongoDB Scala Async Driver

I'm evaluating the MongoDB async driver:

https://github.com/mongodb/mongo-scala-driver

The API looks pretty simply, but how could I do the following transformation?

val collection: MongoCollection[Document] = database.getCollection("test")

I would like to do an implicit transformation when I do CRUD operations on the database. I could not find enough information in the reference documentation on how to do an implicit transformation.

Could anyone point me to any reference on how to do an implicit transformation?

Scala驱动程序只是围绕Java驱动程序的一个薄包装,而不是一个纯粹的实现:( ...因此,您必须遵循Java驱动程序的约定并提供编解码器。我没有可用的示例,但是您应该能够请遵循以下步骤: http : //mongodb.github.io/mongo-java-driver/3.3/bson/codecs/并为scala类注册编解码器。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM