rethinkdb / rethinkdb/docs

Mistake on website

Open
#1,364 1 comment 1 reaction 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

In live example on your website there is a mistake.
in code

r.table('game').orderBy('score').limit(3).changes()

you show TOP PLAYER SCORES.

In your docs orderBy func has default ascending order. So result must be LOWER PLAYER SCORES.

Something like this:

r.table('game').orderBy('score').limit(3)
[
  {
    "id":  "1f759459-0879-4f60-ad9c-04660c156e3f" ,
    "player":  "anthony" ,
    "score": 32
  } ,
  {
    "id":  "6c20ce37-7ecf-4053-a00d-6a5465135c30" ,
    "player":  "jeroen" ,
    "score": 33
  } ,
  {
    "id":  "8c0a26b8-94fb-4aa7-9374-a92255391211" ,
    "player":  "zachary" ,
    "score": 36
  }
]

The other result with using r.desc:

r.table('game').orderBy(r.desc('score')).limit(3)
[
  {
    "id": "45f8099a-6187-4cca-9f4d-f014d33083c8",
    "player": "josh",
    "score": 138
  },
  {
    "id": "2a870b82-0d65-4da3-bbbc-c8936b2064b2",
    "player": "slava",
    "score": 115
  },
  {
    "id": "99f95df6-f3ef-48f3-bfc1-54b42a4eeae4",
    "player": "skyla",
    "score": 103
  }
]

Or I understood something wrong?

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

Start with the live example on the linked RethinkDB website and compare its orderBy usage with the documented default ascending order. Verify the displayed TOP PLAYER SCORES label and the r.desc('score') example, then update the example so its label and results match the ordering shown.

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
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.