I'm using play framework and mongo scala driver to set a database up, I need to parse the result of a query to Json to send it to the front-end:
def getAllProcess(userId: String) = {
getCollection(COMPANY_FORM).find(equal("userId", userId)).subscribe(new Observer[Document] {
override def onError(e: Throwable): Unit = println(e)
override def onComplete(): Unit = println("Complete")
override def onNext(result: Document): Unit = println(result)
})
}
How to parse its result ?