It's funny though, MongoDB was born to respond to the schema problems in RDBMS. You don't have to migrate anything, all you have to do is set the default value in the schema definition if the field is required.
new Schema({
name: { type: string }
})
to:
new Schema({
name: { type: string },
birthplace: { type: string, required: true, default: 'neverborn' }
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…