修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

服务器的MAC地址

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
申请天数
审批时间
过期时间
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

搜索
    中文

      WITH

      概述

      WITH子句对别名代表的数据进行函数运算或笛卡尔积组合,并将结果传递给后面的子句。

      语法

      WITH <expression> as <alias>, <expression> as <alias>, ...
      
      • <expression>是别名运算表达式
      • <alias>是为运算结果定义的别名,可省略

      请留意:

      • 输入到WITH子句的别名异源时,WITH会对异源别名按行进行笛卡尔积组合。
      • 在WITH子句中对某个别名使用dedup()函数去重时,会影响其同源别名的长度。

      例如,以下语句中,别名n2和path同源,别名n1与它们异源:

      • 第一个WITH子句对n2.color的去重操作会影响其同源数据流pnodes(path)的长度
      • 第二个WITH子句对异源别名n1和list做笛卡尔积组合时,同样会影响list的同源别名color的长度
      find().nodes() as n1 limit 2
      n(3).e()[2].n(as n2) as path
      with pnodes(path) as list, dedup(n2.color) as color
      with n1, list
      return n1, list, color
      

      示例

      示例图集

      在一个空图集中,依次运行以下各行语句创建示例图集:

      create().node_schema("account").node_schema("movie").edge_schema("rate").edge_schema("wishlist")
      create().node_property(@*, "name").node_property(@account, "age", int32).node_property(@movie, "year", int32).edge_property(@rate, "score", int32)
      insert().into(@account).nodes([{_id:"S001", _uuid:1, name:"Pepe", age:24}, {_id:"S002", _uuid:2, name:"Lina", age:23}, {_id:"S003", _uuid:3, name:"Emma", age:26}])
      insert().into(@movie).nodes([{_id:"M001", _uuid:4, name:"Léon", year:1994}, {_id:"M002", _uuid:5, name:"Avatar", year:2009}])
      insert().into(@rate).edges([{_uuid:1, _from_uuid:1, _to_uuid:4, score:9}, {_uuid:2, _from_uuid:3, _to_uuid:5, score:8}])
      insert().into(@wishlist).edges([{_uuid:3, _from_uuid:2, _to_uuid:4}, {_uuid:4, _from_uuid:3, _to_uuid:4}])
      

      函数运算

      本例查找age属性值最小所有的@account点,返回他们的name属性:

      find().nodes({@account}) as a
      with min(a.age) as minAge
      find().nodes({@account.age == minAge}) as b
      return b.name
      

      Lina
      

      如果用以下按age属性值升序排列并限制返回一条数据的方法,可能无法得到所有年龄最小的@account点:

      find().nodes({@account}) as a
      order by a.age
      return a.name limit 1
      

      笛卡尔积组合

      本例将@account点和@movie点配对组合,再查找“账号-[]-电影”1步路径,没有结果的组合返回null:

      find().nodes({@account}) as a
      find().nodes({@movie}) as b
      with a, b
      optional n(a).e().n(b) as p
      return p{*}
      

      Pepe --@rate--> Léon
      null --null-- null
      Lina --@wishlist--> Léon
      null --null-- null
      Emma --@wishlist--> Léon
      Emma --@rate--> Avatar
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写