Change Password

Please enter the password.
Please enter the password. Between 8-64 characters. Not identical to your email address. Contain at least 3 of: uppercase, lowercase, numbers, and special characters.
Please enter the password.
Submit

Change Nickname

Current Nickname:
Submit

Apply New License

License Detail

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.

Leave it blank if an HDC service is not required.

Please complete this required field.

Leave it blank if an HDC service is not required.

Please complete this required field.

Please complete this required field.

Mac addresses of all servers, separated by line break or comma.

Please complete this required field.

Please complete this required field.

Cancel
Apply
ID
Product
Status
Cores
Maximum Shard Services
Maximum Total Cores for Shard Service
Maximum HDC Services
Maximum Total Cores for HDC Service
Applied Validity Period(days)
Effective Date
Expired Date
Mac Address
Reason for Application
Review Comment
Close
Profile
  • Full Name:
  • Phone:
  • Company:
  • Company Email:
Change Password
Apply

You have no license application record.

Apply
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

Product Created On ID Amount (USD) Invoice
Product Created On ID Amount (USD) Invoice

No Invoice

v5.0
Search
    English
    v5.0

      Data Export

      This section introduces methods for exporting nodes and edges from graphs.

      export()

      Exports nodes or edges from the graph.

      Parameters

      • exportRequest: ExportRequest: Configurations for the export request, including attributes dbType, schema, selectProperties and graph.
      • listener: RequestType.ExportListener: The callback function that gets executed when data is exported.

      Returns

      • Void.

      // Exports 'account' nodes in the graph 'miniCircle'
      
      const exportRequest = new ExportRequest();
      exportRequest.setDbType(DBType.DBNODE);
      exportRequest.setSchema("account");
      exportRequest.setGraph("miniCircle");
      exportRequest.addSelectProperties("_id");
      exportRequest.addSelectProperties("name");
      exportRequest.addSelectProperties("year");
      exportRequest.setLimit(100);
      
      const allNodes: any[] = [];
      
      await conn.export(exportRequest, {
        stream: {
          onStart: () => {
            console.log("Export started");
          },
          onData: async (data) => {
            allNodes.push(...data);
          },
          onEnd: () => {
            console.log("Export completed. Total nodes:", allNodes.length);
      
            if (allNodes.length === 0) {
              console.log("No data received.");
              return;
            }
      
            try {
              const csv = parse(allNodes);
              const filePath = "./account_nodes.csv";
              fs.writeFileSync(filePath, csv, "utf8");
              console.log(`CSV export completed: ${filePath}`);
            } catch (err) {
              console.error("Failed to write a row to CSV:", err);
            }
          },
        },
      });
      

      Export started
      Export finished. Total nodes: 111
      CSV export completed: ./account_nodes.csv
      

      The file account_nodes.csv is exported to the same directory as the file you executed.

      Full Example

      import { UltipaDriver } from "@ultipa-graph/ultipa-driver";
      import { ULTIPA } from "@ultipa-graph/ultipa-driver/dist/types";
      import {
        DBType,
        ExportRequest,
      } from "@ultipa-graph/ultipa-driver/src/proto/ultipa_pb";
      
      import * as fs from "fs";
      import { parse } from "json2csv";
      
      let sdkUsage = async () => {
        // URI example: ultipaConfig.hosts: ["mqj4zouys.us-east-1.cloud.ultipa.com:60010"]
        const ultipaConfig: ULTIPA.UltipaConfig = {
          hosts: ["192.168.1.85:60061", "192.168.1.87:60061", "192.168.1.88:60061"],
          username: "<username>",
          password: "<password>"
        };
      
        const conn = new UltipaDriver(ultipaConfig);
        const isSuccess = await conn.test();
        console.log(`Connection succeeds: ${isSuccess}`);
      
        // Exports 'account' nodes in the graph 'miniCircle'
      
        const exportRequest = new ExportRequest();
        exportRequest.setDbType(DBType.DBNODE);
        exportRequest.setSchema("account");
        exportRequest.setGraph("miniCircle");
        exportRequest.addSelectProperties("_id");
        exportRequest.addSelectProperties("name");
        exportRequest.addSelectProperties("year");
        exportRequest.setLimit(100);
      
        const allNodes: any[] = [];
      
        await conn.export(exportRequest, {
          stream: {
            onStart: () => {
              console.log("Export started");
            },
            onData: async (data) => {
              allNodes.push(...data);
            },
            onEnd: () => {
              console.log("Export completed. Total nodes:", allNodes.length);
      
              if (allNodes.length === 0) {
                console.log("No data received.");
                return;
              }
      
              try {
                const csv = parse(allNodes);
                const filePath = "./account_nodes.csv";
                fs.writeFileSync(filePath, csv, "utf8");
                console.log(`CSV export completed: ${filePath}`);
              } catch (err) {
                console.error("Failed to write a row to CSV:", err);
              }
            },
          },
        });
      };
      
      sdkUsage().catch(console.error);
      
      Please complete the following information to download this book
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      Privacy Policy.
      Please agree to continue.