Compiler error on nested futures response with Play and ReactiveMongo Compiler error on nested futures response with Play and ReactiveMongo mongodb mongodb

Compiler error on nested futures response with Play and ReactiveMongo


Try changing this line:

futureResult.map { result =>

To this:

futureResult.flatMap { result =>

When you are performing a map on a future and inside that map block are returning another future you need to use flatMap instead as it will flatten out the nesting.