Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hint() does not support strings? #77

Open
nainy opened this issue May 31, 2016 · 1 comment
Open

hint() does not support strings? #77

nainy opened this issue May 31, 2016 · 1 comment

Comments

@nainy
Copy link

nainy commented May 31, 2016

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.

@Fonger
Copy link
Contributor

Fonger commented Jul 31, 2018

I can't reproduce this issue. Just add test case for hint in #108.
If the string is not a valid index name, it will be rejected.

The index name looks like age_1 or age_-1
Make sure you have created the index prior to the query. Otherwise it will be rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants