Closed Zony7 closed 1 year ago
There is a line
.order().by(values, desc).by(keys, asc)
in the gremlin you provided. but there is no such attribute in the provided schema
There is a line
.order().by(values, desc).by(keys, asc)
in the gremlin you provided. but there is no such attribute in the provided schema
In this statement I wrote, "values" and "keys" are attribute names used for sorting. In this context, they are extracted from the previous results, specifically corresponding to the key and value used in the
.groupCount().by("tag.name")`
step, rather than referring to specific properties in the schema statement.
A similar query that also makes use of "values" can function correctly, as shown below:
result = g.V().has("Person","id",$personId).repeat(both("Person_knows_Person"))
.emit().times(2)
.dedup().has("id", neq($personId))
.as("friends")
.in("Post_hasCreator_Person")
.where(
__.out("Post_hasTag_Tag").has("name",$tagName)
)
.as("Post")
.out("Post_hasTag_Tag")
.has("name", neq($tagName))
.as('Tag')
.project("postId","tagName")
.by(select("Post").values("id"))
.by(select("Tag").values("name"))
.dedup()
.groupCount().by(select("tagName"))
.unfold()
.order().by(values, desc).by(keys, asc)
.limit(10)
.project("otherTag.name","postCount")
.by(select(keys))
.by(select(values))
result
So,I think it is not that problem,thank u
Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label
@Zony7 Did you solve this problem?
Problem Type (问题类型)
gremlin (结果不合预期)
Before submit
Environment (环境信息)
Your Question (问题描述)
我准备用gremlin语句实现如下两个查询:
Vertex/Edge example (问题点 / 边数据举例)
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)