Accepted answer

roughly something like this:

val items =
  GroupItems.join(Items).on(_.itemId === // <- query fetching items with group_ids
            .mapValues(_._2) // <- mapping Map values to only items

// render groups to json and add a field items with the items (I may be wrong about Play's json api names)
val json = => Json.toJson(g) ++ JsObject("items" -> Json.toJson(items(

Related Query

More Query from same tag