Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Mar 31, 2024
1 parent 63d220a commit 6704029
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ case class Collection[D <: Document[D]](db: LightDB, mapping: ObjectMapping[D],
data.get(id)
}

def getAll(ids: fs2.Stream[IO, Id[D]]): fs2.Stream[IO, D] = ids.evalMap(get).collect {
case Some(d) => d
}

def getAll(ids: List[Id[D]]): IO[List[D]] = getAll(fs2.Stream(ids: _*)).compile.toList

def fromArray(array: Array[Byte]): D = data.fromArray(array)

def apply(id: Id[D]): IO[D] = data(id)
Expand Down

0 comments on commit 6704029

Please sign in to comment.