dimanche 1 mars 2015

NodeJS add element to Object


I need to add element to existing Object.


Exemple of Object (Mongoose):



param: {
hello: 'Olá Mundo PT '
}


And I need to add new element, ex :



params.param.set(JSON.parse('{"'+req.param('param')+'":"'+req.param('trans')+'"}'));

//And I tryed push

params.param.push(JSON.parse('{"'+req.param('param')+'":"'+req.param('trans')+'"}'));


But nothing works...





Aucun commentaire:

Enregistrer un commentaire