hello there, i am new to scala and trying to make examples in the driver page work. but i cant seem to do very basic things like printing results from a query .
this is my code and it doesnt print anything to the screen.
is there a tutorial that can bring me up to the speed ?
val mongoClient: MongoClient = MongoClient()
val database: MongoDatabase = mongoClient.getDatabase("db")
val collection: MongoCollection[Document] = database.getCollection("small")
var observable: FindObservable[Document] = collection.find();
observable.subscribe(new Observer[Document] {
override def onNext(result: Document): Unit = println(result.toJson())
override def onError(e: Throwable): Unit = println("Failed: " + e.getMessage)
override def onComplete(): Unit = println("Completed")
})