How to return the data in mongoose to the front end in the form of object?

  mongodb, question
The data sent by the front desk are as follows:
 var send_data = {
 "username" : "yyy2",
 "age" :22,
 "address": "Xi 'an",
 "hobby" : ""
 The first step is to traverse and update the database data:
 router.get("/admin/info/edit",function (req, res, next) {
 User.findOne({_id : req.session.user._id},function (err, doc) {
 if(err) return next(err);
 req.session.user = doc;
 });"/admin/info/edit",function (req, res, next) {
 var send_data = {
 username : req.body.username,
 age : req.body.age,
 address : req.body.address,
 hobby : req.body.hobby,
 sex :,
 weight : req.body.weight,
 tall : req.body.tall,
 pic_path : req.body.avatar,
 date : moment().format()
 User.findOne({_id:req.session.user._id}).lean().exec(function (err, doc) {
 if(err) return res.json({error : err.toString()});
 User.update({_id:req.session.user._id },send_data,function (err, doc) {
 if(err) return res.json({error : err.toString()});
 res.json({status : "ok!"  ,code : doc});
 //Want to send the updated data back to the foreground in the form of object


The first piece of data in the above figure is the data sent by the foreground. The second data is the data returned after the background update.

The problem is that I want the format of the code to look the same as sedn_data after returning (I can see the specific key and value directly), but at present, the front end can only see object, not the specific key and value inside. However, when $.each () is used to facilitate the object, the specific key and value can also be obtained. the reason why I can traverse it is because I know the data model in the background. for those who do not know the data model, what he sees is only an object, and those who do not understand will think it is a string.

I’m very sorry, I didn’t describe the problem in detail before. I’m sorry!

May I ask the great gods how to solve this problem?

It’s object. Just expand it