Skip to content

Commit

Permalink
Use all instead of compile.stream.toList
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Nov 27, 2024
1 parent 43d47d8 commit cd4a648
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions modules/ingestor/src/main/scala/mongo.chapter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ object ChapterRepo:
def byStudyIds(ids: List[String]): IO[Map[String, StudyData]] =
coll
.aggregateWithCodec[StudyData](Query.aggregate(ids))
.stream
.compile
.toList
.all
.flatTap(docs => Logger[IO].debug(s"Received $docs chapters"))
.map(_.map(x => x._id -> x).toMap)

0 comments on commit cd4a648

Please sign in to comment.