I have the following document in Mongodb:
{ "index_column" : "site_id", "mapped_column":"site_name"}
I'm using the mongo-scala-driver from my scala code to query the server. How do I get the mapped_column to a scala String variable? I tried with the following code:
val result = mongocollection.find(equal("index_column", data)).first()
It returns a org.mongodb.scala.ObservableImplicits$BoxedObservable@207c9b87
Is it possible to convert the Observable to an Iterator? I just need the mapped_column value in a scala String variable.
I resolved this issue by switching the driver to mongodb casbah and it can be done with the following code: