hint() does not support strings?

Open
#77 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, mongodb
Domain
database

Research direction

Start from the hint() entry point in mquery and trace how its argument is validated and forwarded to MongoDB; the issue gives the MongoDB cursor.hint documentation but names no files. Add support for a string index name alongside the existing hint form, then cover it with a test that checks the generated query. Done means hint('index_name') is accepted and represented correctly in the built query.

Written by the indexing model from the issue text.

Description

It seems like this is indeed the case, unless I'm missing something.
https://docs.mongodb.com/manual/reference/method/cursor.hint/#cursor.hint

According to mongodb documentation ^ , it is possible to pass a string (index name) to the hint() method.

Would really love this to be implemented, to be honest.

Dominant language
JavaScript
Stars
485
Forks
68
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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.

More from mongoosejs/mquery

All issues in mongoosejs/mquery

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.