Skip to content

Add hint support#129

Merged
daffl merged 3 commits intofeathersjs:masterfrom
EliSadaka:patch-1
Dec 17, 2018
Merged

Add hint support#129
daffl merged 3 commits intofeathersjs:masterfrom
EliSadaka:patch-1

Conversation

@EliSadaka
Copy link
Copy Markdown
Contributor

Summary

Adds support for the hint param in find queries: https://docs.mongodb.com/manual/reference/method/cursor.hint/

Other Information

Usage examples:

const query = { userId: 12345 };
const hint = { userId: 1 };
users.find({ query, hint }).then( ... );
const query = { userId: 12345 };
const hint = "index_name";
users.find({ query, hint }).then( ... );

This test creates a partial index in the `people` collection, then performs a query for all items in the collection. Since the query forces the partial index to be used, only the item with the `team` field is retrieved.
@daffl
Copy link
Copy Markdown
Member

daffl commented Dec 17, 2018

Great, thank you!

@daffl daffl merged commit 2c74620 into feathersjs:master Dec 17, 2018
@EliSadaka EliSadaka deleted the patch-1 branch January 4, 2019 15:32
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

Successfully merging this pull request may close these issues.

2 participants