Add a new attribute to existing json object in node.js

后端 未结 7 1903
梦如初夏
梦如初夏 2021-01-17 07:16

I have an object like this

==================records=========={ Id: 5114a3c21203e0d811000088,
  userId: \'test\',
  sUserId: test,
  userName: \'test\',
  ur         


        
7条回答
  •  情歌与酒
    2021-01-17 07:59

    Those finding this problem, OP mentioned in a comment below the original question that the solution for this problem is:

    records.set('Name', 'test')
    

    This adds a new attribute called Name having value test.

提交回复
热议问题