Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** list all lanes */
- def index = Action { implicit request =>
- Async {
- val cursor = collection.find(
- BSONDocument(), BSONDocument()).cursor[Lane] // get all the fields of all the lanes
- val futureList = cursor.toList // convert it to a list of lane
- futureList.map { lanes => Ok(Json.toJson(lanes)) } // convert it to a JSON and return it
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement