-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Update CRUD Tests #1622
Update CRUD Tests #1622
Conversation
an object, not an array, is now returned
@jlord and I spoke offline about this, my general comments are that we need update the inline documentation, and also update the migration guide indicating that this is a breaking change |
lib/collection.js
Outdated
@@ -724,7 +714,7 @@ define.classMethod('bulkWrite', { callback: true, promise: true }); | |||
* @typedef {Object} Collection~insertWriteOpResult | |||
* @property {Number} insertedCount The total amount of documents inserted. | |||
* @property {object[]} ops All the documents inserted using insertOne/insertMany/replaceOne. Documents contain the _id field if forceServerObjectId == false for insertOne/insertMany | |||
* @property {ObjectId[]} insertedIds All the generated _id's for the inserted documents. | |||
* @property {ObjectId[]} insertedIds Map of the index of the inserted document to the id of the inserted document. |
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.
We should change the jsdoc type to {Object.<string, ObjectId}
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.
agreed, but I think its actually {Object.<Number, ObjectId>}
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.
Right, that :)
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.
👍
@jlord this needs to be rebased |
This updates the CRUD tests in these ways:
bulkWrite
to pass onarrayFilters
insertMany
to returninsertedIds
in the correct formatbulkWrite
,insertOne
andinsertMany
For review ease, skip the first commit which dumps the new files in ✨
🍍
NODE-1228