iridium
Advanced tools
Comparing version 7.1.0 to 7.1.2
@@ -284,3 +284,3 @@ "use strict"; | ||
return new Bluebird((resolve, reject) => { | ||
this.collection.findOneAndUpdate({ _id: object._id }, object, { | ||
this.collection.findOneAndUpdate({ _id: object._id || { $exists: false } }, object, { | ||
upsert: options.upsert, | ||
@@ -287,0 +287,0 @@ returnOriginal: false |
@@ -181,2 +181,5 @@ "use strict"; | ||
}); | ||
it("should generate an _id for new, upserted, documents", () => { | ||
return chai.expect(model.create({ answer: 12 }, { upsert: true })).to.eventually.exist.and.have.property("_id").and.exist; | ||
}); | ||
it("should return an error if you don't meet the schema validation requirements", () => { | ||
@@ -221,2 +224,5 @@ return chai.expect(model.create({ answer: "wrong" })).to.eventually.be.rejected; | ||
}); | ||
it("should generate an _id for new, upserted, documents", () => { | ||
return chai.expect(model.insert({ answer: 12 }, { upsert: true })).to.eventually.exist.and.have.property("_id").and.exist; | ||
}); | ||
it("should return an error if you don't meet the schema validation requirements", () => { | ||
@@ -223,0 +229,0 @@ return chai.expect(model.insert({ answer: "wrong" })).to.eventually.be.rejected; |
{ | ||
"name": "iridium", | ||
"version": "7.1.0", | ||
"version": "7.1.2", | ||
"author": "Benjamin Pannell <admin@sierrasoftworks.com>", | ||
@@ -53,6 +53,6 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users", | ||
"dependencies": { | ||
"@types/bluebird": "^3.0.33", | ||
"@types/lodash": "^4.14.36", | ||
"@types/mongodb": "^2.1.33", | ||
"@types/chai": "^3.4.33", | ||
"@types/bluebird": "^3.0.37", | ||
"@types/lodash": "^4.14.52", | ||
"@types/mongodb": "^2.1.38", | ||
"@types/chai": "^3.4.34", | ||
"bluebird": "^3.4.6", | ||
@@ -64,6 +64,6 @@ "lodash": "^4.16.2", | ||
"peerDependencies": { | ||
"@types/bluebird": "^3.0.33", | ||
"@types/lodash": "^4.14.36", | ||
"@types/mongodb": "^2.1.33", | ||
"@types/chai": "^3.4.33" | ||
"@types/bluebird": "^3.0.37", | ||
"@types/lodash": "^4.14.52", | ||
"@types/mongodb": "^2.1.38", | ||
"@types/chai": "^3.4.34" | ||
}, | ||
@@ -73,3 +73,3 @@ "devDependencies": { | ||
"@types/chai-as-promised": "^0.0.29", | ||
"@types/mocha": "^2.2.32", | ||
"@types/mocha": "^2.2.39", | ||
"@types/source-map-support": "^0.2.28", | ||
@@ -76,0 +76,0 @@ "chai": "^3.5.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
700758
7540
Updated@types/bluebird@^3.0.37
Updated@types/chai@^3.4.34
Updated@types/lodash@^4.14.52
Updated@types/mongodb@^2.1.38