Skip to content

fix potential issue with setting geoNear.query to undefined #6696

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

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented May 20, 2020

Fixes a potential issue as reported in #6540.

  • The $geoNear.query parameter will not be set to undefined if no query is given.
  • Added test cases.

Even though the issue in #6540 could not be reproduced (test cases passed for MongoDB 4.0.4, 4.3.2 when $geoNear.query parameter is set to undefined) the issue may occur only with certain MongoDB versions or in certain setups.

Test cases do not have the `query` parameter set in $geoNear aggregation stage. this is to test for a reported potential issue when the parameter is not set.
@codecov
Copy link

codecov bot commented May 20, 2020

Codecov Report

Merging #6696 into master will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6696      +/-   ##
==========================================
- Coverage   93.92%   93.87%   -0.05%     
==========================================
  Files         169      169              
  Lines       12209    12209              
==========================================
- Hits        11467    11461       -6     
- Misses        742      748       +6     
Impacted Files Coverage Δ
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 93.58% <100.00%> (ø)
src/GraphQL/parseGraphQLUtils.js 93.93% <0.00%> (-6.07%) ⬇️
src/GraphQL/loaders/filesMutations.js 83.33% <0.00%> (-2.78%) ⬇️
src/GraphQL/loaders/parseClassQueries.js 97.95% <0.00%> (-2.05%) ⬇️
src/GraphQL/ParseGraphQLSchema.js 97.46% <0.00%> (-0.51%) ⬇️
src/RestWrite.js 93.64% <0.00%> (-0.17%) ⬇️

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 5b71993...c407380. Read the comment docs.

@mtrezza mtrezza closed this Jul 27, 2020
@mtrezza mtrezza reopened this Jul 27, 2020
@mtrezza mtrezza changed the title add test cases for geoNear aggregation fix potential issue with setting geoNear.query to undefined Jul 27, 2020
@mtrezza mtrezza requested review from dplewis and Moumouls July 27, 2020 02:24
@matheusdavidson
Copy link

This PR solves the geoNear.query undefined problem

@mtrezza mtrezza merged commit 5fd73a7 into parse-community:master Sep 8, 2020
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.

3 participants