I have a huge object collection in mongoDB. These are basically products from a shopping website fetched from their APIs. Stored like:
{
"id": "some_id"
"baseInfo": {
"identifiers": {
"attributes": {
"description": "some desc"
"title": "some title"
"price": {
"amount": "amount"
"currency": "currency"
}
"....": "..."
... snip ....
}
}
}
}
This info keeps on changing and is updated by a python script hitting their API continuously.
What would be the easiest way to maintain what changes occurred to which object at what time. For example: in Nth run of the script, at time T1 the product with ID=I, changed it's price from P1 to P2. Similarly, N+1th run at time T2 the price was changed to P3. So basically what would be the easiest way to store the pricing history of the product with ID=I?