|
|
@ -312,7 +312,9 @@ Datastore.prototype.prepareDocumentForInsertion = function (newDoc) { |
|
|
|
preparedDoc = []; |
|
|
|
preparedDoc = []; |
|
|
|
newDoc.forEach(function (doc) { preparedDoc.push(self.prepareDocumentForInsertion(doc)); }); |
|
|
|
newDoc.forEach(function (doc) { preparedDoc.push(self.prepareDocumentForInsertion(doc)); }); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
newDoc._id = newDoc._id || this.createNewId(); |
|
|
|
if (newDoc._id === undefined) { |
|
|
|
|
|
|
|
newDoc._id = this.createNewId(); |
|
|
|
|
|
|
|
} |
|
|
|
preparedDoc = model.deepCopy(newDoc); |
|
|
|
preparedDoc = model.deepCopy(newDoc); |
|
|
|
model.checkObject(preparedDoc); |
|
|
|
model.checkObject(preparedDoc); |
|
|
|
} |
|
|
|
} |
|
|
|