I am trying to design a cosmos db which I am showing below. In my json format below, the majority of items will be uploaded once, then the nested item of “Trades”, will be once per day. In “Trades”, I will have a reference to another container of “price”, which will be updated every few seconds.
Once per day I want to delete the “Trades”, and add a new set of “Trades”.
In cosmos, is this a good design? Meaning can I delete and add a new set of “Trades” once per day, leaving the rest of the json item below the same?
<code>{
"ClientId": "1",
"ClientName": "firstclient",
"Accounts":[
{
"Number": "12345",
"Name": "Berkshire Hathaway ( BRK.A)",
"Market Capitalization": "$308 billion"
"Manager": [
"name": "trader1",
"strategy": "win"
]
"Trades": [
"marketname": "gold"
"quantity" : 1,
"marketid" : "1" -- this is a reference to another container
]
}
]
}
}
</code>
<code>{
"ClientId": "1",
"ClientName": "firstclient",
"Accounts":[
{
"Number": "12345",
"Name": "Berkshire Hathaway ( BRK.A)",
"Market Capitalization": "$308 billion"
"Manager": [
"name": "trader1",
"strategy": "win"
]
"Trades": [
"marketname": "gold"
"quantity" : 1,
"marketid" : "1" -- this is a reference to another container
]
}
]
}
}
</code>
{
"ClientId": "1",
"ClientName": "firstclient",
"Accounts":[
{
"Number": "12345",
"Name": "Berkshire Hathaway ( BRK.A)",
"Market Capitalization": "$308 billion"
"Manager": [
"name": "trader1",
"strategy": "win"
]
"Trades": [
"marketname": "gold"
"quantity" : 1,
"marketid" : "1" -- this is a reference to another container
]
}
]
}
}
1