ReactiveMongo retrieving return value of findAndUpdate
<p>Using the previous <a href="https://stackoverflow.com/questions/35548420/get-the-return-value-of-reactivemongo-findandupdate-function">answer</a> for ReactiveMongo 0.12.0 (<code>"org.reactivemongo" %% "play2-reactivemongo" % "0.12.0"</code>) and Play 2.5.10.</p>

<p>The code updates the MongoDB document perfectly but never returns the value from the database. Have tried various ways, but <code>findAndUpdate</code> never returns a value. Appreciate any help.</p>

<pre><code>@Singleton
//class Counters extends Controller with MongoController {
class Counters @Inject()(val reactiveMongoApi: ReactiveMongoApi)(implicit exec: ExecutionContext) extends Controller with MongoController with ReactiveMongoComponents {  

def collection: JSONCollection = db.collection[JSONCollection]("counters")
def collectionBSON: BSONCollection = db.collection[BSONCollection]("counters")   

def incrementCounter(name: String):Future[Option[Long]] =  {
      import reactivemongo.api.collections.bson.BSONBatchCommands.FindAndModifyCommand.FindAndModifyResult   

      implicit val reader = Macros.reader[Counter]


      val resultFut: Future[FindAndModifyResult] = collectionBSON.findAndUpdate(
        BSONDocument("name" -&gt; COUNTER_NAME),
        BSONDocument("$inc" -&gt; BSONDocument("seq" -&gt; 5)),
        fetchNewObject = true,
        upsert = true
      )
      //resultFut.map(_.result[Counter])

      val updatedCountOpt = resultFut.map { r =&gt;
        r.result[Counter].map { p =&gt;
          println("=====inside Counters.scala p.seq=" + p.seq)
          p.seq
        }
      }

      updatedCountOpt
  }
</code></pre>