Is there a way to let one field take value of two other fields merged as default. I have a user schema as follows:
const UserSchema = mongoose.Schema({
firstName: {
type: String,
required: true,
},
lastName: {
type: String,
required: true,
},});
I want to add a third field called fullName that defaults to merging firstName
+ lastName
Is that possible in mongoose?