As rightly commented by @Mark Brown, I figured that - "It is not possible to specify an object as your partition key in Cosmos DB" , however I did a nested partition key path , like so:
import com.azure.spring.data.cosmos.core.mapping.Container;
@Container(containerName = "DcLogins", partitionKeyPath = "/result/company",autoScale = true)
public class DcLogins {
private Result result;
public class Result {
private String company;
Just to mention, in the partitionKeyPath
, the result
is object of Result
and company
variable in should match the json object your dealing with {"company":"sapcustid","secret":"my secret"}