enumerate deprecated, Use `.enumerator` from Play Iteratee modules

174 views
Skip to first unread message

Alexandre Russel

unread,
Jun 22, 2016, 8:22:47 AM6/22/16
to ReactiveMongo - http://reactivemongo.org
Hi,

 could someone show  (including import and libraries) how to migrate the deprecated code:

cursor.enumerate

Unit test and documentation are still showing it, but it is marked as deprecated with the message: "Use `.enumerator` from Play Iteratee modules"

Thanks,
Alex

Cédric Chantepie

unread,
Jun 22, 2016, 10:34:13 AM6/22/16
to ReactiveMongo - http://reactivemongo.org
Hi,

The iteratee support is being moved to a separate module.
You can see examples of how to use it in the tests of this module.

Cédric Chantepie

unread,
Jun 22, 2016, 10:40:33 AM6/22/16
to ReactiveMongo - http://reactivemongo.org

Neil Chaudhuri

unread,
Sep 16, 2016, 8:13:42 PM9/16/16
to ReactiveMongo - http://reactivemongo.org
The tests link is broken. Meanwhile, CursorSpec contains tests for methods that are all deprecated (all the enumerate* methods). Can you provide a sample or at least point me to the tests that demonstrate how to stream cursors now?

Thanks.

Neil Chaudhuri

unread,
Sep 16, 2016, 8:29:47 PM9/16/16
to ReactiveMongo - http://reactivemongo.org
Well, I do see the foldResponses and foldResponsesM, but it isn't clear how they work and what the differences are. Any guidance is appreciated.

Cédric Chantepie

unread,
Sep 16, 2016, 8:52:00 PM9/16/16
to ReactiveMongo - http://reactivemongo.org
- The `.foldX` are provided for a custom streaming, and documented in the API reference: http://reactivemongo.org/releases/0.11/api/index.html#reactivemongo.api.Cursor@foldWhile[A](z:=%3EA,maxDocs:Int)(suc:(A,T)=%3Ereactivemongo.api.Cursor.State[A],err:reactivemongo.api.Cursor.ErrorHandler[A])(implicitctx:scala.concurrent.ExecutionContext):scala.concurrent.Future[A]
- The previous CursorSpec should obviously go on testing the deprecated enumerate function to ensure the backward compatibility.
- As indicated in the deprecation message, the iteratee support is being moved as a separate module, so that's where the up-to-date tests and example can be found: https://github.com/ReactiveMongo/ReactiveMongo-Streaming/blob/master/iteratees/src/test/scala/CursorSpec.scala

Neil Chaudhuri

unread,
Sep 16, 2016, 9:20:37 PM9/16/16
to ReactiveMongo - http://reactivemongo.org
This information is very helpful. Thanks.
Reply all
Reply to author
Forward
0 new messages