From cd4a64850ac9865a09d9acc17ee6cfda43b2b386 Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Wed, 27 Nov 2024 21:36:26 +0100 Subject: [PATCH] Use all instead of compile.stream.toList --- modules/ingestor/src/main/scala/mongo.chapter.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/ingestor/src/main/scala/mongo.chapter.scala b/modules/ingestor/src/main/scala/mongo.chapter.scala index 2d87eb2..78bc37e 100644 --- a/modules/ingestor/src/main/scala/mongo.chapter.scala +++ b/modules/ingestor/src/main/scala/mongo.chapter.scala @@ -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)