Am building a nodejs app and it has very many clients with different timezones. I save all the data in Unix time stamp, when a client logs in i use the clients timezone to add or subtract to the unix time stamp stored in the database, so that it matches the clients time.
The user data (a document/object), has keys with Arrays and other objects aswell,
{
name: "data",
location": "us",
activity: [],
time: 1476301165252,
subdoc: [{
time: 1476301165252,
someotherKeys: ....
}]
}
How can i loop through this document and edit all the "time" keys(including inner objects and arrays aswell) and add or subtract a number to all "time" keys respectively.
The number will be uniform. meaning all the "time" keys will be iterated with the same number.