The mongo driver exposes query cursors as reactive publisher.
When using FS2 interoperability with reactive streams, I could observe that we query elements one by one, leading to a lot of DB queries, leading to bad performances.
Mongo log:
command":{"getMore":3736877399621840227,"collection":"test","batchSize":2
Mongo log:
"command":{"getMore":5259084578442247860,"collection":"test","batchSize":8
docker-compose up -d
in sbt:
runMain mongo_fs2.Populate
in sbt:
run
and select the main class to run
After several discussions, we can up with a way to demand several elements at the same time: typelevel/fs2#2666