jsArray retrieves only `batchSize` records from JsCursor

12 views
Skip to first unread message

Dmitry Voronov

unread,
Jan 15, 2016, 7:01:57 AM1/15/16
to ReactiveMongo - http://reactivemongo.org
Hi! 

I'm using play 2.3.x and reactiveMongo 0.11.7.play23
My collection size is about 50000 records

When I try to: 
collection
.find(query)
.sort(Json.obj("ip" -> 1))
.cursor[JsValue](ReadPreference.primary)
.jsArray()
.map { rows =>
        println
(rows.value.size)
}
I get exactly 101 records (as default batchSize, I suppose)
jsArray(5), jsArray(555) doesn't affect resulting response size

The same query:
collection
.find(query)
.sort(Json.obj("ip" -> 1))
.cursor[JsValue](ReadPreference.primary)
.collect[List]()
.map { rows =>
    println
(rows.value.size)
}
produces full (50000) rows.

I think it's a bug in jsArray()
I didn't notice any changes in 0.11.9, so I didn't upgrade.

Does anyone have same issues?

--
Best Regards, 
Dmitry

Cédric Chantepie

unread,
Jan 16, 2016, 7:02:30 PM1/16/16
to ReactiveMongo - http://reactivemongo.org
Hi, the cursor is being checked. Best regards.
Reply all
Reply to author
Forward
0 new messages