我试图在我的 JavaScript 对象中添加一个嵌套对象。在网上找不到任何解决方案。
我有一个来自服务器的响应,并且我需要在将相同的数据存储到数据库之前设置一些值。
以下是对象:
任何帮助都将是极好的! :)
以下是对象:
"currentMembership": {
"messages": {
"isUnlimited": false,
"count": 5
},
"likes": {
"isUnlimited": false,
"count": 5
},
"matches": {
"isUnlimited": false,
"count": 0,
"validFor": 0
},
"backtrack": {
"isUnlimited": false,
"count": 0
}
}
我正在尝试为我的某些对象添加dailyCount对象,以便返回的对象更新为:
"currentMembership": {
"messages": {
"dailyCount": {
"date": "2019-12-10T19:33:22.793Z"
"count": 5
},
"isUnlimited": false,
"count": 5
},
"likes": {
"dailyCount": {
"date": "2019-12-10T19:33:16.664Z",
"count": 5
},
"isUnlimited": false,
"count": 5
},
"matches": {
"dailyCount": {
"date": "2019-12-10T19:33:16.697Z",
"count": 0
},
"isUnlimited": false,
"count": 0,
"validFor": 0
},
"backtrack": {
"dailyCount": {
"date": "2019-12-10T19:33:16.701Z",
"count": 0
},
"isUnlimited": false,
"count": 0
},
"hasPremiumPlan": false,
"hasDMPlan": false,
"filters": false
}
任何帮助都将是极好的! :)