When Mongoose creates a new document, the default value of the document's Mixed type field cannot be inserted into the database

version:

Mongoose = 4.13.14
mongodb = 3.2.20

problem description

for example, use mongoose to create a new document, and fields of type Mixed (or Object) cannot be inserted into the database even if the default value is set. What is the reason for this?

related codes

const Mixed = mongoose.Schema.Types.Mixed;
//
document = {
  version: {type: Number, default: 0},
  data: {type: Mixed, default: {}},
};
//schema
...
//
testData = {
  version: 1,
  data: {}
}

testDoc = new (mongoose.model(document))(testData);
//testDoc{version:1}testDoc.data{}

checked the relevant documents but did not find a clue, please do not hesitate to comment ah, thank you!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c2766d-3bc12.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c2766d-3bc12.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?