Guest User

Untitled

a guest
Jul 22nd, 2019
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. val messageIdsInAgoraQuery = quote {
  2. query[ClientMessages]
  3. .leftJoin(query[Comments])
  4. .on {
  5. case (messages, comments) => messages.messageId == comments.commentId
  6. }
  7. .map {
  8. case (messages, maybeComments) => (messages.messageId, maybeComments.map(_.commentId))
  9. }
  10. .groupBy {
  11. case (messageId, _) => messageId
  12. }
  13. .map {
  14. case (messageId, rows) => (messageId, rows.map(_._2).size)
  15. }
  16. }
RAW Paste Data