BSON handlers implicits (suggested in comment) might not work because FindAndModify command has a strict signature to return Option[BSONDocument]
FindAndModify extends BSONCommandResultMaker[Option[BSONDocument]]
given the returned result is of Future[Option[BSONDocument]]
type
you can import the json formats
import play.modules.reactivemongo.json.BSONFormats._
and apply
result.map(docOpt => docOpt.map(d => Json.toJson(d)))
on result, or call the conversion directly
import play.modules.reactivemongo.json.BSONFormats
result.map(docOpt => docOpt.map(d =>
BSONFormats.BSONDocumentFormat.writes(d).as[JsObject]))