如何查询(CQL)具有一对多PK列关系的Cassandra复合PK表?
我有一张卡桑德拉桌子:如何查询(CQL)具有一对多PK列关系的Cassandra复合PK表?,cassandra,cql,composite-primary-key,Cassandra,Cql,Composite Primary Key,我有一张卡桑德拉桌子: PropertiesOfThing ------------------ thingID text propertyName text, propertyValue, primary key (thingID, propertyName) 记录可以是: thingID propertyName propertyValue 1 x v1x 1 y v1y 2 y v2y
PropertiesOfThing
------------------
thingID text
propertyName text,
propertyValue,
primary key (thingID, propertyName)
记录可以是:
thingID propertyName propertyValue
1 x v1x
1 y v1y
2 y v2y
如何查找没有特定属性名称(例如x)的thingID?什么是正确的CQL?做到这一点的“Cassandra”方法是为您可能要执行的每个select查询使用一个表-以这样一种方式对其进行建模,即查询是自然的。我应该如何对其进行建模以找出不具有propertyName=x的thingID(结果应该是thingID=2)-您能解释一下吗?您不能这样查询,但是您可以获得具有特定propertyName的thingID列表