Does azure cosmos db cassandra api support compound primary key?

Bhat, Vivek (NonEmp) 21 Reputation points
2020-06-12T09:43:03.237+00:00

Referring to https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useCompoundPrimaryKeyConcept.html.

I have a schema in which I have multiple primary keys which is something similar to this:

CREATE TABLE cyclist_category ( 
category text, 
points int, 
id UUID, 
lastname text,     
PRIMARY KEY (category, points)
) WITH CLUSTERING ORDER BY (points DESC);

Can I create a similar schema in azure cosmos db with cassandra api?

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

Accepted answer
  1. Mark Brown - MSFT 2,761 Reputation points Microsoft Employee
    2020-06-12T13:44:52.71+00:00

    In Cosmos DB the primary key maps to the partition key where we don't yet support compound partition keys. You would have to concatenate the values here as a work around.

    Thanks.


0 additional answers

Sort by: Most helpful