We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e7ab25 commit 41ad80aCopy full SHA for 41ad80a
test/document.test.js
@@ -7292,6 +7292,22 @@ describe('document', function() {
7292
assert.equal(doc.nested.prop, '3');
7293
});
7294
7295
+ it('supports setting date properties with strict: false (gh-7907)', function() {
7296
+ const schema = Schema({}, { strict: false });
7297
+ const SettingsModel = db.model('gh7907', schema);
7298
+
7299
+ const date = new Date();
7300
+ const obj = new SettingsModel({
7301
+ timestamp: date,
7302
+ subDoc: {
7303
+ timestamp: date
7304
+ }
7305
+ });
7306
7307
+ assert.strictEqual(obj.timestamp, date);
7308
+ assert.strictEqual(obj.subDoc.timestamp, date);
7309
7310
7311
it('handles .set() on doc array within embedded discriminator (gh-7656)', function() {
7312
const pageElementSchema = new Schema({
7313
type: { type: String, required: true }
0 commit comments