Gremlin 集 属性 操作

Gremlin set property operations

我有下面提到的数据集

g.addV('testvertex').property(id, 'user1').property(set, 'states','TX').property(set,'states','CA').property(set,'states','AL').property(set,'states','AK')
  1. 如何找到 'user1' 居住过的州数?
  2. 如果 'user1' 曾经住在 'IA' 和 'KS' ?
  3. 如何从状态集中删除 'TX'?

how do I find the count of states 'user1' has lived in?

g.V().values('states').count()

if 'user1' ever lived in 'IA' and 'KS' ?

g.V().has(id,'user1').has('states', within('IA','KS'))

how do i drop 'TX' from states set ?

g.V().has(id,'user1').
  properties('states').hasValue('TX').drop()