I have following structure in MongoDB:
{
"system_id": 133657,
"type": "personal",
"prices": {
"7": {
"min": 0.05,
"max": 0.05,
"avg": 0.05,
"sales": 1
},
"14": {
"min": 0.05,
"max": 0.05,
"avg": 0.05,
"sales": 3
},
"30": {
"min": 0.03,
"max": 0.04,
"avg": 0.03,
"sales": 8
}
},
"prices_updated_at": { "$date": "2022-05-25T04:48:43.469Z" }
}
Is it possible to iterate and multiply all price values (min, max, avg) by for example 2 and output it in the same structure? Keys (1, 7, 14) are not fixed and can have different values, depending on sale stats.
All I've found was array and not object related.
Thanks for any help!