Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 如何将ReactiveMongo流媒体与聚合一起使用?_Scala_Akka Stream_Reactivemongo - Fatal编程技术网

Scala 如何将ReactiveMongo流媒体与聚合一起使用?

Scala 如何将ReactiveMongo流媒体与聚合一起使用?,scala,akka-stream,reactivemongo,Scala,Akka Stream,Reactivemongo,我用的是ReactiveMongo。我希望在集合上运行一组管道(即使用Mongo聚合框架),并对结果进行流式处理。我想将它们作为BSON文档检索 我看到过这样的例子: coll.aggregatorContext[BSONDocument](pipelines.head, pipelines.tail).prepared[AkkaStreamCursor].cursor.documentSource() 这给我带来了一个编译错误,因为我缺少一个隐式的CursorProducer.Aux[BSO

我用的是ReactiveMongo。我希望在集合上运行一组管道(即使用Mongo聚合框架),并对结果进行流式处理。我想将它们作为BSON文档检索

我看到过这样的例子:

coll.aggregatorContext[BSONDocument](pipelines.head, pipelines.tail).prepared[AkkaStreamCursor].cursor.documentSource()
这给我带来了一个编译错误,因为我缺少一个隐式的
CursorProducer.Aux[BSONDocument,AkkaStreamCursor]
,但我不知道如何导入或构造其中一个--找不到示例。(请不要让我参考ReactiveMongo测试,因为我看不到其中的一个例子,或者不明白我在看什么(如果有)

我应该补充一点,我正在使用0.20.3版的ReactiveMongo

如果我的问题是因为我选择将结果检索为BSON焦点,并且有另一种类型可以找到现有的隐式
CursorProducer.Aux
,如果有人能告诉我如何编译它,我会很高兴地切换

因此,IntelliJ告诉我,
.prepared
缺少一个隐式

但是,一个sbt编译告诉我我的问题是,
AkkaStreamCursor
没有满足
.prepared
的类型界限:

type arguments [reactivemongo.akkastream.AkkaStreamCursor] do not conform to method prepared's type parameter bounds [AC[_] <: reactivemongo.api.Cursor.WithOps[_]]

类型参数[reactivemongo.akkastream.AkkaStreamCursor]不符合准备好的方法的类型参数边界[AC[\u]
游标与任何其他游标使用相同的机制,因此请首先阅读说明如何从游标流式处理。也请信任SBT而不是IntelliJ(这对于复杂类型不是很好),1.0.0版已经发布了一些时间。我已经按照文档建议导入了reactivemongo.akkastream.cursorProducer。如果我从.prepared中删除类型[AkkaStreamCursor],那么我会得到
值documentSource不是reactivemongo.api.Cursor.WithOps的成员[reactivemongo.api.bson.BSONDocument]
。请使用Ahhh检查您的代码,因此如果我使用。准备[AkkaStreamCursor.WithOps],它会编译。谢谢!文档中根本不清楚这一点。