Aur*_*ter 12 properties gremlin
如何使用 Gremlin 更新图中节点的现有属性?
以下方法创建两个具有 2 个不同值的属性“timestamp”,而不是更新现有属性“timestamp”:
ContentGraph.g.addV('Filter').property('timestamp', new Date());
ContentGraph.g.V().hasLabel('Filter').property('timestamp', new Date());
Run Code Online (Sandbox Code Playgroud)
Kel*_*nce 22
我不确定您使用的是哪个图形数据库,但有些数据库(例如 Amazon Neptune)的默认基数为 set。您可以使用 Cardinality.single 枚举覆盖该基数设置。
ContentGraph.g.addV('Filter').property('timestamp', new Date());
ContentGraph.g.V().hasLabel('Filter').property(single,'timestamp', new Date());
Run Code Online (Sandbox Code Playgroud)
希望有帮助,开尔文
| 归档时间: |
|
| 查看次数: |
2818 次 |
| 最近记录: |