修改密码

请输入密码
请输入密码 请输入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

搜索

      找边

      概述

      找边子句find().edges()从图集中获取符合过滤条件的边。

      语法

      字句别名: 数据类型为EDGE;默认别名为edges

      方法
      参数类型
      参数规范
      必须
      描述
      别名
      edges() Filter / 用来获取指定边的过滤条件 N/A
      limit() Integer ≥-1 每个子查询返回的结果数,-1表示返回所有 N/A

      示例

      示例图集

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

      create().node_schema("professor").node_schema("student").edge_schema("mentor").edge_schema("assist")
      create().node_property(@*, "age", int32).node_property(@*, "email", string).edge_property(@*, "year", int32)
      insert().into(@professor).nodes([{_id:"P001",_uuid:1,age:53,email:"test@yahoo.cn"},{_id:"P002",_uuid:2,age:27,email:"test@ultipa.com"}])
      insert().into(@student).nodes([{_id:"S001",_uuid:3,age:27,email:"test@yeah.net"},{_id:"S002",_uuid:4,age:20,email:"test@w3.org"},{_id:"S003",_uuid:5,age:25,email:"test@gmail.com"}])
      insert().into(@mentor).edges([{_uuid:1, _from_uuid:2, _to_uuid:3, year:2020},{_uuid:2, _from_uuid:1, _to_uuid:3, year:2021},{_uuid:3, _from_uuid:1, _to_uuid:4, year:2021},{_uuid:4, _from_uuid:1, _to_uuid:5, year:2022}])
      insert().into(@assist).edges([{_uuid:5, _from_uuid:3, _to_uuid:2, year:2020},{_uuid:6, _from_uuid:4, _to_uuid:1, year:2022}])
      

      无过滤条件

      find().edges() as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      1 P002 S001 2 3 mentor 2020
      2 P001 S001 1 3 mentor 2021
      3 P001 S002 1 4 mentor 2021
      4 P001 S003 1 5 mentor 2022
      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      5 S001 P002 3 2 assist 2020
      6 S002 P001 4 1 assist 2022

      过滤UUID

      find().edges(1) as e
      return e{*}
      

      过滤条件{_uuid == 1}可简写为1

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      1 P002 S001 2 3 mentor 2020

      find().edges([1,3]) as e
      return e{*}
      

      过滤条件{_uuid in [1,3]}可简写为[1,3]

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      1 P002 S001 2 3 mentor 2020
      3 P001 S002 1 4 mentor 2021

      过滤起点

      find().edges({_from == "P001"}) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      2 P001 S001 1 3 mentor 2021
      3 P001 S002 1 4 mentor 2021
      4 P001 S003 1 5 mentor 2022

      过滤终点

      find().edges({_to == "P001"}) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      6 S002 P001 4 1 assist 2022

      过滤Schema

      find().edges({@assist}) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      5 S001 P002 3 2 assist 2020
      6 S002 P001 4 1 assist 2022

      find().edges({@assist || @mentor}) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      1 P002 S001 2 3 mentor 2020
      2 P001 S001 1 3 mentor 2021
      3 P001 S002 1 4 mentor 2021
      4 P001 S003 1 5 mentor 2022
      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      5 S001 P002 3 2 assist 2020
      6 S002 P001 4 1 assist 2022

      过滤属性值

      find().edges({year == 2020}) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      1 P002 S001 2 3 mentor 2020
      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      5 S001 P002 3 2 assist 2020

      过滤Schema和属性值

      find().edges({@assist.year == 2020}) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      5 S001 P002 3 2 assist 2020

      使用默认子句别名

      find().edges().limit(3)
      return edges{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      1 P002 S001 2 3 mentor 2020
      2 P001 S001 1 3 mentor 2021
      3 P001 S002 1 4 mentor 2021

      限制查询数量

      find().edges().limit(3) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      1 P002 S001 2 3 mentor 2020
      2 P001 S001 1 3 mentor 2021
      3 P001 S002 1 4 mentor 2021

      使用前缀OPTIONAL

      uncollect [2022, 2023, 2024] as value
      optional find().edges({year == value}) as e
      return e{*}
      

      结果:

      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      4 P001 S003 1 5 mentor 2022
      _uuid _from _to
      _from_uuid
      _to_uuid Schema year
      6 S002 P001 4 1 assist 2022
      _uuid _from _to
      _from_uuid
      _to_uuid Schema
      null null null null null null
      null null null null null null

      如果没有使用前缀OPTIONAL,查询无结果时无返回值。

      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写