I'm currently playing around with Akka Streams and the Alpakka MongoDB connector.
Is it possible to specify the type for MongoSource
?
val codecRegistry = fromRegistries(fromProviders(classOf[TodoMongo]), DEFAULT_CODEC_REGISTRY)
private val todoCollection: MongoCollection[TodoMongo] = mongoDb
.withCodecRegistry(codecRegistry)
.getCollection("todo")
I would like to do something like this:
val t: FindObservable[Seq[TodoMongo]] = todoCollection.find()
MongoSource(t) // Stuck here
But I get the following error:
Expected Observable[scala.Document], Actual FindObservable[Seq[TodoMongo]].
I can't find the correct documentation about this part.