Advertisement
Guest User

Untitled

a guest
Mar 1st, 2014
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.38 KB | None | 0 0
  1.   /** list all lanes */
  2.   def index = Action { implicit request =>
  3.     Async {
  4.       val cursor = collection.find(
  5.         BSONDocument(), BSONDocument()).cursor[Lane] // get all the fields of all the lanes
  6.       val futureList = cursor.toList // convert it to a list of lane
  7.       futureList.map { lanes => Ok(Json.toJson(lanes)) } // convert it to a JSON and return it
  8.     }
  9.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement