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

feat: add explain MongoDB queries #314

Merged
merged 2 commits into from
Jan 8, 2022

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Jan 8, 2022

New Pull Request Checklist

Issue Description

The Swift SDK can't explain MongoDB queries due to a bug on the server-side response. PR parse-community/parse-server#7440 was created on the server, but the server team has chosen not to fix the code.

Originally discussed in: https://community.parseplatform.org/t/explain-result-in-parseswift/1557

Related issue: #N/A parse-community/parse-server#7442

Approach

Add a new internal response type that doesn't expect results to be an array. When the user wants to explain a mongo query, they set the flag, isUsingMongoDB=true. This allows the mongo explained queries to use the same methods as the ones already in the SDK.

TODOs before merging

  • Add tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jan 8, 2022

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Jan 8, 2022

Codecov Report

Merging #314 (cd8b006) into main (e6c2db2) will increase coverage by 0.00%.
The diff coverage is 94.05%.

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #314    +/-   ##
========================================
  Coverage   84.62%   84.62%            
========================================
  Files         114      114            
  Lines       11718    11845   +127     
========================================
+ Hits         9916    10024   +108     
- Misses       1802     1821    +19     
Impacted Files Coverage Δ
Sources/ParseSwift/API/Responses.swift 91.25% <ø> (ø)
Sources/ParseSwift/Types/Query.swift 92.28% <92.81%> (-0.89%) ⬇️
Sources/ParseSwift/Types/Query+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Types/Query+combine.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 72.92% <0.00%> (-0.60%) ⬇️

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 e6c2db2...cd8b006. Read the comment docs.

@cbaker6 cbaker6 merged commit b92667f into parse-community:main Jan 8, 2022
@cbaker6 cbaker6 deleted the explainMongo branch January 8, 2022 17:29
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.

None yet

1 participant