I have one application that posts messages to Cosmos DB by reading messages from another application database. The only information I can get from other app is documentId i.e. primary key from the app database and the body of the message. Structure is something as below:
{
"id":<documentid>,
"body":<body picked up from App>,
"Timestamp":<today's date time>
}
Body contains simple text message like "Hello World! Today is Wednesday". I have the following requirements: 1. Need to query document by documentId. 2. Need to query documents between two date/time stamps.
- DocumentId is unique and no duplicate values are allowed.
In this scenario, how can we identify a partition key for the container to retrieve documents easily by the two criterion specified above?
Any inputs are highly appreciated.