无法分配io.reeactivex.flowable< io.reeactivex.maybe>到:io.reeactivex.flowable< object>
希望你们都做意志。我对此非常陌生,我一直在遇到不兼容类型的问题。
Flowable<Boolean> checkTriggerDaily() {
List<Bson> fields = new ArrayList<Bson>();
fields.add(exists("dueDate", true));
Bson filter = and(fields);
Flowable.fromPublisher(marketplaceMongoService.getCollection().find(filter)).map{ third ->
getTheReport(third.id).flatMap { size ->
TaskService.createTasks(size).toFlowable().flatMap({})
}
}
}
我一直在标题上遇到相同的错误。此功能的作用是循环通过mongo collection,并致电getThereport每个项目。 getThereportreturns,我将其处理为createTasks功能。
getThereport-&gt;返回也许 createTasks - &gt;返回也许
Hope You're all doing will. I'm very new to this and I keep getting issues with incompatible types.
Flowable<Boolean> checkTriggerDaily() {
List<Bson> fields = new ArrayList<Bson>();
fields.add(exists("dueDate", true));
Bson filter = and(fields);
Flowable.fromPublisher(marketplaceMongoService.getCollection().find(filter)).map{ third ->
getTheReport(third.id).flatMap { size ->
TaskService.createTasks(size).toFlowable().flatMap({})
}
}
}
I keep getting the same error on the title. What this function does is loop through a mongo collection and call getTheReport every item. What the getTheReportReturns, i process it to createTasks function.
getTheReport -> returns Maybe
createTasks -> returns Maybe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于
结果是
Flotalbe
,因此您应该调用FlatMap
而不是MAP
,以便将内部函数发射的对象被解开为A flat /em>结果:Since
result is a
Flowalbe
, you should callflatMap
instead ofmap
so that the internal function emitted objects get unpacked into a flat result: