我打算使用reactiveMongo来实现CRUD操作,这里是我的在线教程的查找功能。如何打印BSONDocument的内容
def findTicker(ticker: String) = {
val query = BSONDocument("firstName" -> ticker)
val future = collection.find(query).one
future.onComplete {
case Failure(e) => throw e
case Success(result) => {
println(result)
}
}
}
但是我得到这个结果:
Some(BSONDocument(<non-empty>))
我怎样才能真正看到实际可读的JSON数据,我looing为:
{ "_id" : ObjectId("569914557b85c62b49634c1d"), "firstName" : "Stephane", "lastName" : "Godbillon", "age" : 29 }
'BSONDocument.pretty(bsonDoc)'的一件事 – cchantep