Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Add hint support #129

Merged
merged 3 commits into from
Dec 17, 2018
Merged

Add hint support #129

merged 3 commits into from
Dec 17, 2018

Conversation

EliSadaka
Copy link
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
Member

daffl commented Dec 17, 2018

Great, thank you!

@daffl daffl merged commit 2c74620 into feathersjs-ecosystem:master Dec 17, 2018
@EliSadaka EliSadaka deleted the patch-1 branch January 4, 2019 15:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants