Skip to content

[3.x] fix truncate to delete items in collection #1993

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 8 commits into from
Jul 22, 2020
Merged

[3.x] fix truncate to delete items in collection #1993

merged 8 commits into from
Jul 22, 2020

Conversation

Yahatix
Copy link
Contributor

@Yahatix Yahatix commented Mar 10, 2020

Make the truncate function only remove documents and not drop the collection

Resolves: #1306

@codecov-io
Copy link

codecov-io commented Mar 10, 2020

Codecov Report

Merging #1993 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1993      +/-   ##
============================================
- Coverage     87.04%   87.03%   -0.01%     
  Complexity      667      667              
============================================
  Files            31       31              
  Lines          1521     1520       -1     
============================================
- Hits           1324     1323       -1     
  Misses          197      197              
Impacted Files Coverage Δ Complexity Δ
src/Jenssegers/Mongodb/Query/Builder.php 88.85% <100.00%> (-0.04%) 165.00 <1.00> (ø)

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 a7acac7...40f7264. Read the comment docs.

@divine
Copy link
Contributor

divine commented Mar 10, 2020

This should be pushed to develop branch not master, since this is a breaking change.

@Yahatix
Copy link
Contributor Author

Yahatix commented Mar 10, 2020

Sorry this is my first ever pull request and i'm not quite sure how to correct the things you guys have told me. How can i "append" a new commit to this pull request? Or should i make a new pr on the develop branch?

@Smolevich
Copy link
Contributor

I think that you left this PR
@divine this is bug and i think that we should fix in release 3.6.3 based on branch master

@divine
Copy link
Contributor

divine commented Mar 10, 2020

Sorry this is my first ever pull request and i'm not quite sure how to correct the things you guys have told me. How can i "append" a new commit to this pull request? Or should i make a new pr on the develop branch?

Just edit your https://github.com/Yahatix/laravel-mongodb and changes will be reflected here.

--
@Smolevich ok, no problem.

@divine divine changed the title Fixes truncate function #1306 [fix] truncate to delete items in collection Mar 10, 2020
@divine divine changed the title [fix] truncate to delete items in collection [3.x] fix truncate to delete items in collection Mar 10, 2020
Copy link
Contributor

@divine divine left a comment

Choose a reason for hiding this comment

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

Looks good, thank you @Yahatix

@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2020

Codecov Report

Merging #1993 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1993      +/-   ##
============================================
- Coverage     86.89%   86.88%   -0.01%     
  Complexity      671      671              
============================================
  Files            31       31              
  Lines          1557     1556       -1     
============================================
- Hits           1353     1352       -1     
  Misses          204      204              
Impacted Files Coverage Δ Complexity Δ
src/Jenssegers/Mongodb/Query/Builder.php 89.06% <100.00%> (-0.03%) 170.00 <1.00> (ø)

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 08f4995...2223548. Read the comment docs.

@divine
Copy link
Contributor

divine commented Jul 22, 2020

@Smolevich any objections?

@Smolevich Smolevich merged commit 828982f into mongodb:master Jul 22, 2020
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
[3.x] fix truncate to delete items in collection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Truncate should only delete the documents not drop the collection
5 participants