Created
April 5, 2022 04:16
-
-
Save katzkb/031bfbbd77a4f9a0869dd4bcc6cff84c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val result: Seq[UserView] = userSeq.map(user => { // ①ユーザー人数分回る | |
val groupIdSeq: Seq[GroupId] = | |
groupMemberSeq | |
.filter(_.userId == user.id) // ②マッピング数分回る | |
.map(_.groupId) | |
val userGroups: Seq[Group] = | |
groupSeq.filter(group => // ③グループ数分回る | |
groupIdSeq.contains(group.id) | |
) | |
UserView( | |
user.id, | |
user.name, | |
userGroups | |
) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment