|
|
|
@ -915,12 +915,19 @@ describe('Database', function () { |
|
|
|
|
docs.length.should.equal(1); // Default option for upsert is false
|
|
|
|
|
docs[0].something.should.equal("created ok"); |
|
|
|
|
|
|
|
|
|
// Modifying the returned upserted document doesn't modify the database
|
|
|
|
|
newDoc.newField = true; |
|
|
|
|
d.find({}, function (err, docs) { |
|
|
|
|
docs[0].something.should.equal("created ok"); |
|
|
|
|
assert.isUndefined(docs[0].newField); |
|
|
|
|
|
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('Cannot perform update if the update query is not either registered-modifiers-only or copy-only, or contain badly formatted fields', function (done) { |
|
|
|
|
d.insert({ something: 'yup' }, function () { |
|
|
|
|