如何将全名作为名字+姓氏从ejs文件存储到数据库?

问题描述

我编写了以下代码,以将名字和姓氏作为用户在 ejs 文件中的输入。现在,我想将全名存储在数据库中。我怎样才能做到这一点?

ejs 文件中的代码

<label for="Lname" class="abc"> Legal Name:</label>
<input type="text" id="L1name" name="firstName" placeholder="First name">
<input type="text" id="Lname" name="lastName" placeholder="Last name">

models.js 中的代码

const employeeinfocenterschema = new mongoose.Schema({
    firstName: {
        type: String,required: true,},lastName: {
        type: String,fullName: {
        type: String,});

如何在此处获取 fullName?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)