Skip to content

Add support to add hint to Parse.Query #1054

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

Merged
merged 16 commits into from
Jan 16, 2020

Conversation

stevestencil
Copy link
Contributor

@stevestencil stevestencil commented Jan 8, 2020

@codecov
Copy link

codecov bot commented Jan 8, 2020

Codecov Report

Merging #1054 into master will decrease coverage by 0.01%.
The diff coverage is 97.05%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1054      +/-   ##
=========================================
- Coverage   92.21%   92.2%   -0.02%     
=========================================
  Files          54      54              
  Lines        5162    5167       +5     
  Branches     1148    1157       +9     
=========================================
+ Hits         4760    4764       +4     
- Misses        402     403       +1
Impacted Files Coverage Δ
src/promiseUtils.js 91.48% <ø> (ø) ⬆️
src/CoreManager.js 100% <ø> (ø) ⬆️
src/ParseObject.js 89.38% <100%> (-0.08%) ⬇️
src/TaskQueue.js 87.5% <100%> (-1.79%) ⬇️
src/RESTController.js 84% <100%> (-0.22%) ⬇️
src/LiveQueryClient.js 87.76% <100%> (ø) ⬆️
src/ParseUser.js 83.59% <100%> (-0.04%) ⬇️
src/ParseFile.js 96.84% <100%> (+0.12%) ⬆️
src/ParseQuery.js 95.97% <91.66%> (-0.09%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1827459...0328a24. Read the comment docs.

@stevestencil
Copy link
Contributor Author

I can go back and add more test but I want to make sure this is what we're looking for?

Copy link
Member

@dplewis dplewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments. You can add unit tests for now.

Once parse-community/parse-server#6322 is merged then we can add integration tests.

@@ -713,7 +722,8 @@ class ParseQuery {
const controller = CoreManager.getQueryController();
const params = {
distinct: key,
where: this._where
where: this._where,
hint: this._hint ? this._hint : undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just hint: this.hint is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I did this was because I caused tests to fail because in the constructor this._hint is set to null (like readPreference)... so I can either take setting this._hint as null out of the constructor or keep it like this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will know once you start writing tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!


const params = {
pipeline,
hint: this._hint ? this._hint : undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@dplewis
Copy link
Member

dplewis commented Jan 14, 2020

@stevestencil Can you give me access to your branch?

@stevestencil
Copy link
Contributor Author

@dplewis Done!

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome. exposing explain super awesome.

@dplewis dplewis merged commit b1c1c09 into parse-community:master Jan 16, 2020
@dplewis dplewis deleted the query-hint branch January 16, 2020 19:45
stevestencil added a commit to stevestencil/Parse-SDK-JS that referenced this pull request Jan 17, 2020
Add support to add hint to Parse.Query (parse-community#1054)
@TomWFox
Copy link
Contributor

TomWFox commented Apr 5, 2020

Thoughts on documenting this in the guide?

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.

4 participants