我有一个包含以下详细信息的顶点:


{

"requestId": "6ce01f3b-f623-41f6-bb03-dd56014e0701",
"status":

{

"message": "",
"code": ​200,
"attributes": { }

},
"result":
{

"data":

[

{

"id": ​4192,
"label": "person",
"type": "vertex",
"properties":

{

"name":

[

{
    "id": "170-38g-sl",
    "value": "marko2"
}

],
"age":
[

                    {
                        "id": "1l8-38g-28lh",
                        "value": ​29
                    }
                ]
            }
        }
    ],
    "meta": { }
}

}

我想更新顶点名称:

我尝试了以下查询:



但是它没有更新,却给出了错误
{

 "message": "Error encountered evaluating script: g.V(4192).setProperty('name','William')"

}

最佳答案

Traversal上没有称为“setProperty()”的方法。您可以这样做:

g.V(4192).property('name','William')

请在TinkerPop documentation中查看完整的步骤列表。

您也可以直接使用Vertex并执行以下操作:
v = g.V(4192).next()
v.property('name','william')

10-07 23:52