我尝试使用Play 2.4.2和Reactive Mongo 0.11.5在JsonCollection上使用带有selector = {}
的findAll查询集合。
在调用方法foldM
时,play.api.libs.iteratee
内的方法collect[List]
中的查询失败。
我可追踪的最后一个代码是case Input.El(e) => { val newS = executeFuture(f(s, e))(pec); flatten(newS.map(s1 => Cont[E, A](step(s1)))(dec)) }
。
此代码从反应性mongo 0.10.5移植并播放2.3.9。
堆栈跟踪:
java.lang.RuntimeException: null
at scala.sys.package$.error(package.scala:27) ~[scala-library-2.11.6.jar:na]
at play.api.libs.iteratee.Iteratee$$anonfun$run$1.apply(Iteratee.scala:396) ~[play-iteratees_2.11-2.4.2.jar:2.4.2]
at play.api.libs.iteratee.Iteratee$$anonfun$run$1.apply(Iteratee.scala:389) ~[play-iteratees_2.11-2.4.2.jar:2.4.2]
at play.api.libs.iteratee.StepIteratee$$anonfun$fold$2.apply(Iteratee.scala:706) ~[play-iteratees_2.11-2.4.2.jar:2.4.2]
at play.api.libs.iteratee.StepIteratee$$anonfun$fold$2.apply(Iteratee.scala:706) ~[play-iteratees_2.11-2.4.2.jar:2.4.2]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[scala-library-2.11.6.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[scala-library-2.11.6.jar:na]
at play.api.libs.iteratee.Execution$trampoline$.executeScheduled(Execution.scala:109) ~[play-iteratees_2.11-2.4.2.jar:2.4.2]
at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:71) ~[play-iteratees_2.11-2.4.2.jar:2.4.2]
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) ~[scala-library-2.11.6.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) ~[scala-library-2.11.6.jar:na]
at scala.concurrent.Promise$class.complete(Promise.scala:55) ~[scala-library-2.11.6.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) ~[scala-library-2.11.6.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:23) ~[scala-library-2.11.6.jar:na]
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121) ~[scala-library-2.11.6.jar:na]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.11.6.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.11.6.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.11.6.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.11.6.jar:na]
答案 0 :(得分:0)
问题在于DateTime格式我以格式{ date: { $date: 1435723470549 } }
格式处理mongo日期。
这个问题解释了差异:Parsing a Json String in Scala using Play framework,我应该更新它以使用JsDefined
。