修改密码

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

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Blaze (v4)

Standalone

Please complete this required field.

Please complete this required field.

Please complete this required field.

Please complete this required field.

如果不需要 HDC 服务,则此项留空。

Please complete this required field.

如果不需要 HDC 服务,则此项留空。

Please complete this required field.

Please complete this required field.

所有服务器的MAC地址,由换行符或逗号分隔。

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
Shard 服务最大数量
Shard 服务最大总核数
HDC 服务最大数量
HDC 服务最大总核数
申请天数
审批日期
过期日期
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

v4.5
搜索
    v4.5

      连接

      完成安装嬴图Node.js SDK,设置一个运行的嬴图实例后,可以开始将您的应用连接到嬴图图数据库。

      ConnectionPool

      可以使用ConnectionPool来建立与嬴图的连接,该连接池指定所需的连接池信息。

      以下是ConnectionPool的所有可用配置项:

      项目
      类型
      描述
      hosts string[] 数据库主机地址或主机 URI(不包括"https://"或"http://")。对于集群,多个地址用逗号分隔,必填。
      username string 主机认证的用户名,必填。
      password string 主机认证的密码,必填。
      crt Buffer 设置本地证书文件路径,连接将使用 SSL。
      defaultConfig ULTIPA.UltipaConfig 其他配置,包括图集设置、超时和一致性设置。
      otherParams object 包含两个键:isHttps and isHttp,均为布尔值。如果两者都设置为true,优先使用HTTP。如果未指定,连接将优先尝试HTTP,若HTTP 连接失败,则切换到 HTTPS。

      连接到集群

      连接到集群并使用图集“default”的示例。

      import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
      import fs from "fs";
      
      let sdkUsage = async () => {
      
        let hosts = [
          "192.168.1.85:60061", 
          "192.168.1.86:60061", 
          "192.168.1.87:60061"
        ];
        let username = "***";
        let password = "***";
        let crt: Buffer;
        { // 使用证书 (Crt)
          let crt_file_path = "./ultipa.crt";
          crt = fs.readFileSync(crt_file_path);
        }
        let connPool = new ConnectionPool(hosts, username, password, crt);
        
        let conn = await connPool.getActive();
        let isSuccess = await conn.test();
        console.log(isSuccess);
      };
      
      sdkUsage().then(console.log).catch(console.log);
      

      连接到嬴图Cloud

      连接到嬴图Cloud实例并使用图集“default”的示例。

      import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        let hosts = ["3xbotdjas.us-east-1.cloud.ultipa.com:60010"];
        let username = "***";
        let password = "***";
        let otherParams = {
          isHttps: true,
          isHttp: false
        };
        let connPool = new ConnectionPool(hosts, username, password, undefined, undefined, otherParams);
        
        let conn = await connPool.getActive();
        let isSuccess = await conn.test();
        console.log(isSuccess);
      };
      
      sdkUsage().then(console.log).catch(console.log);
      

      Configuration Items

      以下是UltipaConfig的所有可用配置项:

      项目
      类型
      描述
      graphSetName string 要使用的图集名称。如果未设置,则使用建立连接时配置的 graphSetName
      timeout number 请求的超时阈值(以秒为单位)。
      consistency boolean 是否使用主节点以确保一致性读取。
      useHost string 将请求发送到指定的主机节点,若未设置则随机选择主机节点。
      clusterID string 指定要使用的集群。
      timeZone string 要使用的时区。
      timeZoneOffset number 使用的时区与UTC的时差(以分钟为单位)。
      timestampToString boolean 是否将时间戳转换为字符串。
      logUql boolean 是否打印UQL。
      threadNum number 线程数量。
      responseWithRequestInfo boolean 是否在响应中包含请求信息。
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写
      隐私政策 数据处理协议
      请勾选表示您已阅读并同意。

      Copyright © 2019-2025 北京同心尚科技发展有限公司-保留所有权利 京ICP备19040872号-1