将JSON保存到mongodb时出错

时间:2017-11-16 12:40:49

标签: node.js database mongodb mongoose

//将此JSON保存到mongodb

{
    "data":{
        "username" : "xxxx",
        "servername" : "yyy@gmail.com",
        "sender_email" : "zzz@gmail.com",
        "port_no" : "134",
        "password" : "hello123",
        "confirm_password": "hello123",
        "notifiction":{
            "recipient":{
                "run_reports":["xxx4@gmail.com",
                "yyyyn@gmail.com",
                "yyy@gmail.com"],

                "run_analysis":["xxxgmail.com",
                "yy@gmail.com", "yyy@gmail.com","xxx@gmail.com"]
            }

        }
    }
}

//在我的数据库中,其保存类似于

bodyObj { data: 
   { username: 'balajikr',
     servername: 'mail.balaji.com',
     sender_email: 'amsa@gmail.com',
     port_no: '1324',
     password: 'hello123',
     confirm_password: 'hello123',
     notification: { recipient: [Object] } } }

收件人未保存在我的数据库中 帮帮我怎么做 在此先感谢

0 个答案:

没有答案