As Julien Lafont said, you should consider transforming this list before giving it to your template. For example if you just want a list of read files (on which you can call filename and id):

val fileList = // fileList is a List[ReadFile[BSONValue]]]

And if you want just want to get filenames and their ids (given that their ids are BSONObjectIDs), you may write this:

val fileList = { file =>
  val id = match {
    case oid: BSONObjectID => oid.stringify
    case id => id.toString
  id -> file._2.filename
// fileList is a List[(String, String)] where the first element of the tuple is a string version of the id and the second is the name of the file.

Related Query

More Query from same tag