How does Mongodb save data to ensure the integrity of fields?

for example:
my backend model defines an object,

user = {
name: required false,
mobile: required true,
email: required false
}

since my name field and email field are not required, I did not send it at the front end, but passed json:

in the following format
user =  {
mobile: 1118828819
}

the backend receives the json and saves it directly in the MongoDB. When I need to call the user"s information next time, the backend reads the record from the database. However, there is a problem, there are no remaining two fields, which is different from the interface field defined by me and the frontend. How can I solve this problem?

Mar.28,2021
Menu