rethinkdb / docs

RethinkDB documentation
http://rethinkdb.com/docs
Apache License 2.0
117 stars 167 forks source link

docs unclear about `cursor.toArray()` behavior with large datasets #1224

Open benjaminsteward opened 6 years ago

benjaminsteward commented 6 years ago

This line in the description is a little misleading: 'Retrieve all results and pass them as an array to the given callback.'

https://rethinkdb.com/api/javascript/to_array/

I offer this up, because in the case of large datasets (it happened for me at 650+ rows), the callback will be called multiple times, until the data is finished processing. Perhaps the docs can reflect this nuance by adding the following line:

"In the case of large datasets, .toArray() callback may potentially be called multiple times as data is received from the cursor, which may cause errors."

srh commented 6 years ago

I'm pretty sure you're describing a bug. Are you positive you're seeing this?