【问题标题】:Add multiple properties during edge creation in gremlin在 gremlin 中创建边缘期间添加多个属性
【发布时间】:2017-07-05 07:13:42
【问题描述】:

我用过这个查询

g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').properties('startedOn','17/15/07','title','manager','pay',15000) 

这不起作用。

使用.property 步骤添加单个属性

g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').property('startedOn','17/15/07') 

【问题讨论】:

    标签: titan gremlin tinkerpop tinkerpop3


    【解决方案1】:

    您可以简单地连接多个property-steps,而不是在一个property-steps 中指定所有属性:

    g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').
        property('startedOn','17/15/07').property('title','manager').property('pay',15000)
    

    您的查询未指定边应连接哪些顶点。当您希望边从带有empId 123 的顶点出来时,您必须插入一个from

    g.V().has('empId','123').as('a').V().has('deptId','567').addE('worksAt').from('a').
        property('startedOn','17/15/07').property('title','manager').property('pay',15000)
    

    有关详细信息,请参阅addEdge 步骤。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-01
      • 1970-01-01
      相关资源
      最近更新 更多