修改密码

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

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

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