MongoController provides serve function to serve the result of a query (as a Cursor). I just want to do something different than letting serve return NotFound, like sending some other default file. I'm wondering if it is possible to use pattern matching to check the result. The signature is this:
/** Returns a future Result that serves the first matched file, or NotFound. */
def serve[T <: ReadFile[_ <: BSONValue], Structure, Reader[_], Writer[_]](gfs: GridFS[Structure, Reader, Writer], foundFile: Cursor[T], dispositionMode: String = CONTENT_DISPOSITION_ATTACHMENT)(implicit ec: ExecutionContext): Future[SimpleResult] = {
In your action function you can do: