In the official Casbah guide on querying it says
findOne Returns an Option - either Some(MongoDBObject) or None
However, findOne
actually gives me an Option
with a plain Some(DBObject)
instead:
scala> MongoClient("localhost", 27017)("db")("collection").findOne()
res0: Option[com.mongodb.DBObject] = Some({ "_id" : { "$oid" : "559860491b07c0dc5b52f3ee"} , "description" : "Some text" })
The same happens with find
, it returns an iterator over DBObject
instances. After hours of googling and scratching my head I'm at a loss.
What's going on here? I'm still learning Scala so there might be some nuance that I'm not getting.