How to get the result of mongoose save callback from the controller in egg

import { Controller} from "egg";
export default class Login extends Controller{
    public async login(){
        const {ctx}=this;
        ctx.body= await ctx.service.login.login("admin","admin");
    };
    public async register(){
        const {ctx}=this;
        let {username,password}=ctx.query;
        console.log(username);
        ctx.body= await ctx.service.register.register(username,password);
    };
}
< hr >
    public async register(name: String, psw: String) {
        mongoose.connect("mongodb://localhost/egg");
        let loginData = mongoose.Schema({
            username: String,
            password: String
        })
        let loginModel = mongoose.model("loginModel", loginData);
        var data = new loginModel({ username: name, password: psw });
        data.save(function(err){
            if(!err){
                return ""
            }
        });
        return ""
        
    }

how can Controller get the result of asynchronous save callback return in service by using native mongoose instead of egg-monogoose in egg

Mar.25,2021
The problem of

has also bothered me for some time.
can be written as follows:
var data = new loginModel ({username: name, password: psw});
data.save ();
ctx.body = data;
data is the result of writing, and ctx.body = data can be returned to the front end

.
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-1e9f089-1a21.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-1e9f089-1a21.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?