Skip to content

Version 7.1.2

Compare
Choose a tag to compare
@notheotherben notheotherben released this 11 Feb 13:35
· 99 commits to main since this release
v7.1.2
9161b8a

This release fixes the behavior of the Model.insert and Model.create methods when the { upsert: true } option is provided and documents do not include an _id field. Previously, documents would be "upserted" with { _id: null } leading to issues.

As of this release, documents will be upserted using { _id: { $exists: false } } as the default upsert condition when an _id is not provided - resolving this problem.

Please be aware that using { upsert: true } imparts a significant performance penalty on bulk inserts and should be avoided in situations where you are working with a large number of documents. The better approach is to split your document set into documents with _ids and those without, using { upsert: true } only for those in the former set and using { upsert: false } for the rest.