-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(NODE-3565): Error for insertMany with partially empty array is unhelpful #3221
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
Conversation
…o check the expected error message has not been changed, fix grammar issues
src/operations/insert.ts
Outdated
if (err || res == null) { | ||
if (err && err.message === 'Operation must be an object with an operation key') { | ||
err = new MongoInvalidArgumentError( | ||
'Argument "docs" is a sparse array containing element(s) that are null or undefined' |
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.
'Argument "docs" is a sparse array containing element(s) that are null or undefined' | |
'Collection.insertMany() cannot be called with an array that has null/undefined values' |
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.
One non-blocking comment, otherwise LGTM
Description
NODE-3565
What is changing?
Is there new documentation needed for these changes?
No
What is the motivation for this change?
The previous error being thrown was not descriptive.
Double check the following
npm run check:lint
script<type>(NODE-xxxx)<!>: <description>