我有一个Cassandra表Department
,列name_list extends SetColumn[String] with PartitionKey
和id extends StringColumn with PartitionKey
。如何从幻像中的SetColumn [String]中选择字段
我想获取ID所请求的名存在于NAME_LIST。
我试过下面使用此代码,但没有得到任何结果
abstract class Departments extends Table[Departments, Department] with RootConnector {
object id extends StringColumn with PartitionKey
object dep_type extends StringColumn
object name_list extends SetColumn[String] with Index
def getByName(name: String) = {
select(_.id, _.name_list)
.where(_.name_list.contains(name))
.allowFiltering()
.one()
}
}
有什么办法来解决这个问题!
@flavian你可以检查。 –