修改密码

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

v5.0
搜索
    v5.0

      插入

      概述

      使用语句insert()可以向图集的一个schema插入新的点和边。

      // 插入点
      insert().into(<schema>).nodes([
        {<property1?>: <value1?>, <property2?>: <value2?>, ...},
        {<property1?>: <value1?>, <property2?>: <value2?>, ...},
        ...
      ])
      
      // 插入边
      insert().into(<schema>).edges([
        {_from: <fromValue>, _to: <toValue>, <property1?>: <value1?>, <property2?>: <value2?>, ...},
        {_from: <fromValue>, _to: <toValue>, <property1?>: <value1?>, <property2?>: <value2?>, ...},
        ...
      ])
      
      方法
      参数
      描述
      into() <schema> 指定点schema或边schema,如@user
      nodes()edges() 属性规范列表 将一或多个点或边插入指定schema,其中每个属性规范需用{}包裹

      属性规范列表中出现的每个属性都会被赋予给定的值,而缺失的自定义属性将默认赋值为null

      请注意:

      • 点的_id值若未指定,将由系统自动生成;也可根据需要为其指定唯一值。
      • 点和边的_uuid值由系统自动生成,不允许指定。
      • 必须提供边属性_from_to以指明边的起点和终点。

      示例图集

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

      create().node_schema("user").edge_schema("follow")
      create().node_property(@user, "name").node_property(@user, "age", int32).node_property(@user, "location", point).node_property(@user, "isBlocked", bool).node_property(@user, "permissionCodes", "set(uint32)").edge_property(@follow, "time", datetime)
      insert().into(@user).nodes([{_id:"U001", name:"Jason", age:30}, {_id:"U002", name:"Tim"}, {_id:"U003", name:"Grace", age:25}, {_id:"U004", name:"Ted", age:26}])
      insert().into(@follow).edges([{_from:"U004", _to:"U001", time:"2021-9-10"}, {_from:"U003", _to:"U001", time:"2020-3-12"}, {_from:"U004", _to:"U002", time:"2023-7-30"}])
      

      插入单个点/边

      插入一个@user点:

      insert().into(@user).nodes({_id: "U005", name: "Alice"})
      

      插入一条@follow边:

      insert().into(@follow).edges({_from: "U002", _to: "U001", time: "2023-8-9"})
      

      插入单个点或边时,可省略nodes()edges()中的外层方括号[]

      插入多个点/边

      插入三个@user点:

      insert().into(@user).nodes([
        {_id: "U006", name: "Lee", age: 12},
        {name: "Alex"},
        {}
      ])
      

      插入两条@follow边:

      insert().into(@follow).edges([
        {_from: "U001", _to: "U002"},
        {_from: "U004", _to: "U003", time: "2023-9-10"}
      ])
      

      返回插入的数据

      插入两条@follow边并返回插入边的所有信息:

      insert().into(@follow).edges([
        {_from: "U001", _to: "U004"},
        {_from: "U001", _to: "U003", time: "2022-2-7"}
      ]) as e
      return e{*}
      

      结果:e

      _uuid
      _from
      _to
      _from_uuid
      _to_uuid
      schema
      values
      Sys-gen U001 U004 UUID of U001 UUID of U004 follow {time: null}
      Sys-gen U001 U003 UUID of U001 UUID of U003 follow {time: "2022-02-07 00:00:00"}

      插入布尔类型值

      bool类型的属性只接受0(真)或1(假)两个值。如果提供其他值,都自动转换成0

      插入一个@user点,其属性isBlocked的数据类型为bool

      insert().into(@user).nodes({isBlocked: 0})
      

      插入Point类型值

      使用point()函数为point类型属性指定属性值。

      插入一个@user点,其属性location的数据类型为point

      insert().into(@user).nodes([
        {location: point({latitude: 132.1, longitude: -1.5})}
      ]) as n
      return n.location
      

      结果:

      n.location
      POINT(132.1 -1.5)

      插入列表类型值

      插入一个@user点,其属性interests的数据类型为string[]

      insert().into(@user).nodes([
        {interests: ["violin", "tennis", "movie"]}
      ])
      

      插入集合类型值

      插入一个@user点,其属性permissionCodes的数据类型为set(uint32)

      insert().into(@user).nodes([
        {permissionCodes: [1002, 1002, 1003, 1004]}
      ]) as n
      return n.permissionCodes
      

      结果:

      n.permissionCodes
      [1003,1004,1002]

      集合内的元素值会自动去重。

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