Skip to content

Commit

Permalink
Merge pull request #1517 from vkarpov15/patch-2
Browse files Browse the repository at this point in the history
allow saving doc with null `_id`
  • Loading branch information
christkv committed May 22, 2017
2 parents a37812d + 989e826 commit 613cd12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ var insertDocuments = function(self, docs, options, callback) {
// Add _id if not specified
if(forceServerObjectId !== true){
for(var i = 0; i < docs.length; i++) {
if(docs[i]._id == null) docs[i]._id = self.s.pkFactory.createPk();
if(docs[i]._id === void 0) docs[i]._id = self.s.pkFactory.createPk();
}
}

Expand Down

0 comments on commit 613cd12

Please sign in to comment.