rethinkdb / rethinkdb/docs

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

Open
#1,224 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
118
Forks
161
PR merge metrics
No merged PRs in 30d

Description

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."

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked JavaScript toArray API documentation and locate the description containing “Retrieve all results and pass them as an array to the given callback.” Review the documented behavior for large datasets, then update the page to explain the callback behavior accurately; done means the description reflects the reported nuance without misleading readers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.