-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(NODE-4684)!: remove collection insert, update, remove methods #3500
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
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ab9b240
feat(NODE-4648)!: remove collection insert, update, remove methods
nbbeeken a75b4bb
test: remove remove usage
nbbeeken 5088836
assert usage doesn't increase
nbbeeken 282dd49
fix: lint
nbbeeken d73ebba
fix: tests
nbbeeken 7f9e3b3
remove keepGoing test
nbbeeken 672f183
bump permitted legacy
nbbeeken 4c869e1
rename and test clean up
nbbeeken 1a87dae
docs: add migration table
nbbeeken 9dd803c
Merge branch 'main' into NODE-4684-rm-coll-insert-update-remove
nbbeeken c360585
docs: update
nbbeeken 76662d5
Merge branch 'main' into NODE-4684-rm-coll-insert-update-remove
nbbeeken 29c36ce
Update etc/notes/CHANGES_5.0.0.md
nbbeeken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -655,71 +655,6 @@ describe('CRUD API', function () { | |
| } | ||
| }); | ||
|
|
||
| it('should correctly execute remove methods using crud api', { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wasn't using .remove even and is covered by CRUD spec tests |
||
| // Add a tag that our runner can trigger on | ||
| // in this case we are setting that node needs to be higher than 0.10.X to run | ||
| metadata: { | ||
| requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] } | ||
| }, | ||
|
|
||
| test: function (done) { | ||
| client.connect(function (err, client) { | ||
| const db = client.db(); | ||
|
|
||
| // | ||
| // Legacy update method | ||
| // ------------------------------------------------- | ||
| const legacyRemove = function () { | ||
| deleteOne(); | ||
| }; | ||
|
|
||
| // | ||
| // Update one method | ||
| // ------------------------------------------------- | ||
| const deleteOne = function () { | ||
| db.collection('t4_2').insertMany( | ||
| [{ a: 1 }, { a: 1 }], | ||
| { writeConcern: { w: 1 } }, | ||
| (err, r) => { | ||
| expect(err).to.not.exist; | ||
| expect(r).property('insertedCount').to.equal(2); | ||
|
|
||
| db.collection('t4_2').deleteOne({ a: 1 }, (err, r) => { | ||
| expect(err).to.not.exist; | ||
| expect(r).property('deletedCount').to.equal(1); | ||
|
|
||
| deleteMany(); | ||
| }); | ||
| } | ||
| ); | ||
| }; | ||
|
|
||
| // | ||
| // Update many method | ||
| // ------------------------------------------------- | ||
| const deleteMany = function () { | ||
| db.collection('t4_3').insertMany( | ||
| [{ a: 1 }, { a: 1 }], | ||
| { writeConcern: { w: 1 } }, | ||
| (err, r) => { | ||
| expect(err).to.not.exist; | ||
| expect(r).property('insertedCount').to.equal(2); | ||
|
|
||
| db.collection('t4_3').deleteMany({ a: 1 }, (err, r) => { | ||
| expect(err).to.not.exist; | ||
| expect(r).property('deletedCount').to.equal(2); | ||
|
|
||
| client.close(done); | ||
| }); | ||
| } | ||
| ); | ||
| }; | ||
|
|
||
| legacyRemove(); | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| it('should correctly execute findAndModify methods using crud api', { | ||
| // Add a tag that our runner can trigger on | ||
| // in this case we are setting that node needs to be higher than 0.10.X to run | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a thought - a table that has columns for legacy method / existing crud replacement might be an easier format for users to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was thinking something along the lines of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had code samples when I first wrote the table but it isn't easy to read b/c of how wide it gets, it doesn't get the same scroll effect normal code blocks do. Let me fix up the text part and maybe move the code sample below the table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed the change, also the bracket are bit hard to notice, "arrayOfDocuments" is obviously just a variable name that implies something. Maybe I should use type annotations instead?