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

improve field deletion in collection #6823

Merged
merged 4 commits into from
Jul 27, 2020

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Jul 24, 2020

Simply adds a filter to updateMany when deleting the field from the collection. That means that only documents will be updated that contain the field.

In the status quo (without index), this added filter has no effect. But it gives the devop the ability to manually add the required index for the field to be deleted. The index has to be { <fieldNameToDelete>: { $exists: true }}.

Also added an additional test case for field deletion without index, which was missing before, hence increase in coverage.

closes #6815

@mtrezza mtrezza marked this pull request as draft July 24, 2020 00:11
@codecov
Copy link

codecov bot commented Jul 24, 2020

Codecov Report

Merging #6823 into master will decrease coverage by 0.53%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6823      +/-   ##
==========================================
- Coverage   93.87%   93.33%   -0.54%     
==========================================
  Files         169      169              
  Lines       12206    12209       +3     
==========================================
- Hits        11458    11395      -63     
- Misses        748      814      +66     
Impacted Files Coverage Δ
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 93.58% <100.00%> (+0.04%) ⬆️
...dapters/Cache/RedisCacheAdapter/KeyPromiseQueue.js 0.00% <0.00%> (-95.46%) ⬇️
src/Adapters/Cache/RedisCacheAdapter/index.js 12.50% <0.00%> (-82.15%) ⬇️
src/Routers/PushRouter.js 93.10% <0.00%> (-3.45%) ⬇️
src/RestWrite.js 93.81% <0.00%> (+0.16%) ⬆️
src/GraphQL/loaders/filesMutations.js 86.11% <0.00%> (+2.77%) ⬆️

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 9ba9620...88cd6a8. Read the comment docs.

@mtrezza mtrezza marked this pull request as ready for review July 25, 2020 14:01
@mtrezza mtrezza requested a review from Moumouls July 25, 2020 23:35
@mtrezza mtrezza marked this pull request as draft July 26, 2020 14:09
@mtrezza mtrezza marked this pull request as ready for review July 26, 2020 23:22
@mtrezza mtrezza merged commit 5b71993 into parse-community:master Jul 27, 2020
therealjmj pushed a commit to therealjmj/SC-parse-server that referenced this pull request Aug 20, 2020
* added filter to updateMany when deleting field

* added test cases

* added changelog entry
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.

Inefficient column deletion
2 participants