How to set objectId to userId when mongoose creates a user

const UserSchema = new Schema({
    userId:Schema.Types.ObjectId,
    username: String,
    mobile: String,
    password: String,
    //
    remarks: String,
    createAt: {type: Date, default: Date.now},
    updateAt: {type: Date, default: Date.now},
    //
    userType: String
})

this is the user schema, I defined. How do I set the userId value to the default objectId, when I want to default inch data?
when I query, I need to query the data according to the user id or objectId, and how to get the objectId?

the following is the code for me to store the data:

let password = md5(ctx.request.body.password)
            let UserModel = new User({
                username: ctx.request.body.username,
                mobile: ctx.request.body.mobile,
                password: password,
                remarks: ctx.request.body.remarks
            })
            UserModel.save(function (err) {
                if (err) console.log(err)
            })
Mar.08,2021

1. Why can't you use the default id
2. If you customize id, the default id will also automatically generate
3. To use a custom id query, just use a custom field name. Of course, the default id is also a

that you can continue to use.
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-1e9c545-4768f.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-1e9c545-4768f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?