unable to insert json object inside another in node.js -


usersmodel.findone({"username":username}).exec(function (err, users) {           if (err) {                      logger.info("my error "+err);               return res.status(500).send(err);           }           else if(!users)               return res.status(404).send('no user found');           else {               users["account"]="xxxxxxxxx";               return res.status(200).send(users);           }         }); 

i want insert account key pair value inside users json.but return users json not contain account fields.where issue ?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -