我打算使用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