I am currently upgrading to 0.12.RC3 in hope of fixing the following issue I am experiencing. After upgrading, I received a deprecation warning for the collect
method.
So I moved from:
def find(query: JsObject = Json.obj())(implicit reader: Reads[T]): Future[List[T]] = {
collection.flatMap(_.find(query).cursor[T](ReadPreference.nearest).collect[List]())
}
To:
def find(query: JsObject = Json.obj())(implicit reader: Reads[T]): Future[List[T]] = {
collection.flatMap(_.find(query).cursor[T](ReadPreference.nearest).collect[List](Int.MaxValue, Cursor.FailOnError()))
}
However, unfortunately I get the following error:
Type mismatch, expected: (JSONCollection) => Future[NotInferedS], actual: (JSONCollection) => Any