val matchOp = collection.BatchCommands.AggregationFramework.Match(Json.obj())val pipeline = List(collection.BatchCommands.AggregationFramework.Group(Json.toJson("$basic_info.device_uuid"))("install_date" -> collection.BatchCommands.AggregationFramework.First("session_details.launch_time")))val cursor = collection.BatchCommands.AggregationFramework.Cursor(100)val returnedCursor = collection.aggregate[JsValue](matchOp, List(matchOp), Some(cursor), explain = false, allowDiskUse = true, bypassDocumentValidation = true, readConcern = None, readPreference = ReadPreference.Primary)returnedCursor.foldBulks(List.empty[JsValue])({ (ls, iter) =>val list = iter.toListlogger.debug("size " + list.size)Cursor.Cont(ls)}, { (ls, err) =>logger.error("error fetching documents" + err.toString)Cursor.Fail(err)})
size 100size 1size 1size 1size 1size 1size 1size 1size 1
The size of batch for getMore of such command is not yet configurable.