修改密码

请输入密码
请输入密码 请输入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
      • 支持前缀OPTIONAL:若无查询结果,子句返回null
      • 命令:find()
      • 参数:
      参数 类型 规范 必须携带
      描述
      参数别名
      edges() filter / 边的过滤条件 不支持
      limit() int ≥-1 子句每次执行时返回的结果数量,-1表示返回所有 不支持

      没有自行定义find().edges()子句别名时,系统使用默认的edges作为子句别名。此时后续子句不能使用edges来定义别名,否则会引发重名报错。

      示例

      示例图集

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

      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{*}
      

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

      过滤UID

      本例查询_uuid为1和3的边,返回它们的全部信息:

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

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

      过滤起/终点

      本例查询以P001为起点的边,返回它们的全部信息:

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

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

      本例查询以P001为终点的边,返回它们的全部信息:

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

      |---------------------- @assist ----------------------|
      | _uuid | _from | _to  | _from_uuid | _to_uuid | year |
      |-------|-------|------|------------|----------|------|
      |   6   | S002  | P001 | 4          | 1        | 2022 |
      

      过滤Schema

      本例查询@assist边,返回它们的全部信息:

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

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

      过滤属性值

      本例查询year属性值等于2020的边,返回它们的全部信息:

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

      |---------------------- @mentor ----------------------|
      | _uuid | _from | _to  | _from_uuid | _to_uuid | year |
      |-------|-------|------|------------|----------|------|
      |   1   | P002  | S001 | 2          | 3        | 2020 |
      
      |---------------------- @assist ----------------------|
      | _uuid | _from | _to  | _from_uuid | _to_uuid | year |
      |-------|-------|------|------------|----------|------|
      |   5   | S001  | P002 | 3          | 2        | 2020 |
      

      过滤Schema和属性值

      本例查询year属性值等于2020的@assist边,返回它们的全部信息:

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

      |---------------------- @assist ----------------------|
      | _uuid | _from | _to  | _from_uuid | _to_uuid | year |
      |-------|-------|------|------------|----------|------|
      |   5   | S001  | P002 | 3          | 2        | 2020 |
      

      限制查询数量

      本例查询3条边,返回它们的全部信息:

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

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

      使用默认子句别名

      本例查询3条边点,使用默认子句别名,返回它们的全部信息:

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

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

      使用前缀OPTIONAL

      本例查询以S003为起点的边,返回它们的全部信息,由于查询无结果,因此返回null:

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

      null
      

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

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