I’ve got a nosql database (Azure CosmosDB) with a collection that contains, in addition to other properties, records in this format.
{
"id": "0574100324396001",
"StoreId": 574,
"TransactionSequenceNumber": 3960,
"UnitSession": {
"User": "Tom Smith"
"StoreId": 574,
"TillNumber": 1
}
}
The records may get created in any order however I want to ensure that for a given StoreId
and TillNumber
, that the TransactionSequenceNumber
are sequential and that there are no gaps e.g. for StoreId 574, TillNumber 1, there are TransactionSequenceNumbers 3960, 3958, 3959, 3961.
How could I go about doing this?