Composite Key azure cosmos java

Deepak Patil 61 Reputation points

@MetContainer (containerName = "tag")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Tag {

private String tagName;  

private String domainName;  

private String countryDcOrgUnit;  


I need to create container with name tag having tagName and domainName as unique combination.... but after running this i am getting error .. only one field with @Id annotation!
how to crate container with composite key as primary key

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,437 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. Oury Ba-MSFT 16,076 Reputation points Microsoft Employee

    You can use the feature of Nested Partition Key Path in azure-spring-data-cosmos to solve the unique key problem in spring -


    0 comments No comments