以下结果按位置名称计算人数:g.V()hasLabel('people')。out('people_location')。groupCount()。by('name')
我试过这个只过滤那些以US开头的地点列表:gV()hasLabel('people')。out('people_location')。groupCount()。by('name')。matches(“US * “)
和g.V()hasLabel('people')。out('people_location')。匹配(“US *”)。groupCount()。by('name')
但都没有工作。
什么是matches()
?这是OrientDB特定的步骤吗?现在,我只是假设这可能是这里的主要问题,因为我不知道matches
步骤。这就是我要做的:
g.V().hasLabel('people').
out('people_location').has('name', gte('US').and(lt('UT'))).
groupCount().
by('name')
或者,甚至更简单:
g.V().has('location', 'name', gte('US')).
group().
by('name').
by(inE('people_location').count())