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)
  • Ultipa Powerhouse (v5)

Standalone

learn more about the four main severs in the architecture of Ultipa Powerhouse (v5) , click

here

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.2
Search
    English
    v5.2

      Process Query Results

      Methods like gql() and uql() return a Response object containing the raw query results from the database and execution metadata. To use the query results in your application, you need to extract and convert them into a usable data structure.

      Response includes the following fields:

      Field
      Type
      Description
      aliases Alias[] The list of result aliases; each Alias includes fields name and type.
      items [key: string]: DataItem An object where each key is an alias name, and each value is the corresponding query result data.
      explainPlan ExplainPlan The execution plan.
      status Status The status of the execution, including fields code and message.
      statistics Statistics Statistics related to the execution, including fields nodeAffected, edgeAffected, totalCost, and engineCost.

      Extract Query Results

      To extract the query results, i.e., the DataItem object from Response.items, use the get() or alias() method.

      get()

      Extracts query results by the alias index.

      Parameters

      • index: number: Index of the alias.

      Returns

      • DataItem: The query results.

      const response = await driver.gql("MATCH (n)-[e]->() RETURN n, e LIMIT 2");
      console.log(response.get(0));
      

      The GQL query returns two aliases (n, e), the get() method gets the DataItem of the alias n at index 0.

      DataItem {
        alias: 'n',
        type: 2,
        entities: [
          Node {
            uuid: '6557243256474697731',
            id: 'U4',
            schema: 'User',
            values: [Object]
          },
          Node {
            uuid: '7926337543195328514',
            id: 'U2',
            schema: 'User',
            values: [Object]
          }
        ]
      }
      

      alias()

      Extracts query results by the alias name.

      Parameters

      • alias: string: Name of the alias.

      Returns

      • DataItem: The query results.

      const response = await driver.gql("MATCH (n)-[e]->() RETURN n, e LIMIT 2");
      console.log(response.alias("e"));
      

      The GQL query returns two aliases (n, e), the alias() method gets the DataItem of the alias e.

      DataItem {
        alias: 'e',
        type: 3,
        entities: [
          Edge {
            uuid: '2',
            fromUuid: '6557243256474697731',
            toUuid: '7926337543195328514',
            from: 'U4',
            to: 'U2',
            schema: 'Follows',
            values: [Object]
          },
          Edge {
            uuid: '3',
            fromUuid: '7926337543195328514',
            toUuid: '17870285520429383683',
            from: 'U2',
            to: 'U3',
            schema: 'Follows',
            values: [Object]
          }
        ]
      }
      

      Convert Query Results

      You should use a as<DataStructure>() method to convert the DataItem.entities into the corresponding data structure.

      asNodes()

      If a query returns nodes, you can use asNodes() to convert them into a list of Node objects.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("MATCH (n:User) RETURN n LIMIT 2", requestConfig);
      const nodes = response.alias("n").asNodes();
      for (const node of nodes) {
        console.log(node)
      }
      

      Node {
        uuid: '6557243256474697731',
        id: 'U4',
        schema: 'User',
        values: { name: 'mochaeach' }
      }
      Node {
        uuid: '7926337543195328514',
        id: 'U2',
        schema: 'User',
        values: { name: 'Brainy' }
      }
      

      asFirstNode()

      If a query returns nodes, you can use asFirstNode() to convert the first returned node into a Node object.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("MATCH (n:User) RETURN n", requestConfig);
      const node = response.alias("n").asFirstNode();
      console.log(node)
      

      Node {
        uuid: '6557243256474697731',
        id: 'U4',
        schema: 'User',
        values: { name: 'mochaeach' }
      }
      

      asEdges()

      If a query returns edges, you can use asEdges() to convert them into a list of Edge objects.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("MATCH ()-[e]->() RETURN e LIMIT 2", requestConfig);
      const edges = response.alias("e").asEdges();
      for (const edge of edges) {
        console.log(edge)
      }
      

      Edge {
        uuid: '2',
        fromUuid: '6557243256474697731',
        toUuid: '7926337543195328514',
        from: 'U4',
        to: 'U2',
        schema: 'Follows',
        values: { createdOn: '2024-02-10' }
      }
      Edge {
        uuid: '3',
        fromUuid: '7926337543195328514',
        toUuid: '17870285520429383683',
        from: 'U2',
        to: 'U3',
        schema: 'Follows',
        values: { createdOn: '2024-02-01' }
      }
      

      asFirstEdge()

      If a query returns edges, you can use asFirstEdge() to convert the first returned edge into an Edge object.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("MATCH ()-[e]->() RETURN e LIMIT 2", requestConfig);
      const edge = response.alias("e").asFirstEdge();
      console.log(edge)
      

      Edge {
        uuid: '2',
        fromUuid: '6557243256474697731',
        toUuid: '7926337543195328514',
        from: 'U4',
        to: 'U2',
        schema: 'Follows',
        values: { createdOn: '2024-02-10' }
      }
      

      asGraph()

      If a query returns paths, you can use asGraph() to convert them into an Graph object.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("MATCH p = ()-[]->() RETURN p LIMIT 2", requestConfig);
      const graph = response.alias("p").asGraph();
      console.log("Unique nodes:", graph.nodes)
      console.log("Unique edges:", graph.edges)
      console.log("All paths:", graph.paths)
      

      Unique nodes: Map(3) {
        '6557243256474697731' => Node {
          uuid: '6557243256474697731',
          id: 'U4',
          schema: 'User',
          values: { name: 'mochaeach' }
        },
        '7926337543195328514' => Node {
          uuid: '7926337543195328514',
          id: 'U2',
          schema: 'User',
          values: { name: 'Brainy' }
        },
        '17870285520429383683' => Node {
          uuid: '17870285520429383683',
          id: 'U3',
          schema: 'User',
          values: { name: 'purplechalk' }
        }
      }
      Unique edges: Map(2) {
        '2' => Edge {
          uuid: '2',
          fromUuid: '6557243256474697731',
          toUuid: '7926337543195328514',
          from: 'U4',
          to: 'U2',
          schema: 'Follows',
          values: { createdOn: '2024-02-10' }
        },
        '3' => Edge {
          uuid: '3',
          fromUuid: '7926337543195328514',
          toUuid: '17870285520429383683',
          from: 'U2',
          to: 'U3',
          schema: 'Follows',
          values: { createdOn: '2024-02-01' }
        }
      }
      All paths: [
        Path {
          nodeUuids: [ '6557243256474697731', '7926337543195328514' ],
          edgeUuids: [ '2' ],
          nodes: Map(2) {
            '6557243256474697731' => [Node],
            '7926337543195328514' => [Node]
          },
          edges: Map(1) { '2' => [Edge] }
        },
        Path {
          nodeUuids: [ '7926337543195328514', '17870285520429383683' ],
          edgeUuids: [ '3' ],
          nodes: Map(2) {
            '7926337543195328514' => [Node],
            '17870285520429383683' => [Node]
          },
          edges: Map(1) { '3' => [Edge] }
        }
      ]
      

      asGraphSets()

      If a query retrieves graphs (graphsets) in the database, you can use asGraphSets() to convert them into a list of Graphset objects.

      const response = await driver.gql("SHOW GRAPH");
      const graphsets = response.get(0).asGraphSets();
      for (const graphset of graphsets) {
        console.log(graphset)
      }
      

      GraphSet {
        id: '6',
        name: 'miniCircle',
        totalNodes: '97',
        totalEdges: '632',
        shards: [ '1' ],
        partitionBy: 'CityHash64',
        status: 'NORMAL',
        description: '',
        slotNum: 256
      }
      GraphSet {
        id: '16',
        name: 'g1',
        totalNodes: '5',
        totalEdges: '4',
        shards: [ '1', '2', '3' ],
        partitionBy: 'Crc32',
        status: 'NORMAL',
        description: '',
        slotNum: 256
      }
      

      asSchemas()

      If a query retrieves node or edge schemas defined in a graph, you can use asSchemas() to convert them into a list of Schema objects.

      const requestConfig: RequestConfig = { graph: "miniCircle" };
      const response = await driver.gql("SHOW NODE SCHEMA", requestConfig);
      const schemas = response.get(0).asSchemas();
      for (const schema of schemas) {
        console.log(schema)
      }
      

      Schema {
        name: 'default',
        description: 'default schema',
        properties: [],
        dbType: 0,
        total: undefined,
        id: '1',
        stats: []
      }
      Schema {
        name: 'account',
        description: '',
        properties: [
          Property {
            name: 'gender',
            type: 7,
            subType: undefined,
            lte: false,
            read: true,
            write: true,
            schema: 'account',
            description: '',
            encrypt: '',
            decimalExtra: undefined
          },
          Property {
            name: 'year',
            type: 1,
            subType: undefined,
            lte: false,
            read: true,
            write: true,
            schema: 'account',
            description: '',
            encrypt: '',
            decimalExtra: undefined
          },
          Property {
            name: 'industry',
            type: 7,
            subType: undefined,
            lte: false,
            read: true,
            write: true,
            schema: 'account',
            description: '',
            encrypt: '',
            decimalExtra: undefined
          },
          Property {
            name: 'name',
            type: 7,
            subType: undefined,
            lte: false,
            read: true,
            write: true,
            schema: 'account',
            description: '',
            encrypt: '',
            decimalExtra: undefined
          }
        ],
        dbType: 0,
        total: undefined,
        id: '2',
        stats: []
      }
      

      asProperties()

      If a query retrieves node or edge properties defined in a graph, you can use asProperties() to convert them into a list of Property objects.

      const requestConfig: RequestConfig = { graph: "miniCircle" };
      const response = await driver.gql("SHOW NODE account PROPERTY", requestConfig);
      const properties = response.get(0).asProperties();
      for (const property of properties) {
        console.log(property)
      }
      

      Property {
        name: '_id',
        type: 7,
        subType: undefined,
        lte: false,
        read: true,
        write: true,
        schema: 'account',
        description: 'system property',
        encrypt: '',
        decimalExtra: undefined
      }
      Property {
        name: 'gender',
        type: 7,
        subType: undefined,
        lte: false,
        read: true,
        write: true,
        schema: 'account',
        description: '',
        encrypt: '',
        decimalExtra: undefined
      }
      Property {
        name: 'year',
        type: 1,
        subType: undefined,
        lte: false,
        read: true,
        write: true,
        schema: 'account',
        description: '',
        encrypt: '',
        decimalExtra: undefined
      }
      Property {
        name: 'industry',
        type: 7,
        subType: undefined,
        lte: false,
        read: true,
        write: true,
        schema: 'account',
        description: '',
        encrypt: '',
        decimalExtra: undefined
      }
      Property {
        name: 'name',
        type: 7,
        subType: undefined,
        lte: false,
        read: true,
        write: true,
        schema: 'account',
        description: '',
        encrypt: '',
        decimalExtra: undefined
      }
      

      asAttr()

      If a query returns results like property values, expressions, or computed values, you can use asAttr() to convert them into an Attr object.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("MATCH (n:User) LIMIT 2 RETURN n.name", requestConfig);
      const attr = response.alias("n.name").asAttr();
      console.log(attr)
      

      Attr {
        propertyType: 7,
        resultType: 4,
        values: [ 'mochaeach', 'Brainy' ],
        name: 'n.name'
      }
      

      asTable()

      If a query uses the table() function to return a set of rows and columns, you can use asTable() to convert them into a Table object.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("MATCH (n:User) LIMIT 2 RETURN table(n._id, n.name) AS result", requestConfig);
      const table = response.alias("result").asTable();
      console.log(table)
      

      Table {
        name: 'result',
        headers: [
          Header { propertyName: 'n._id', propertyType: 7 },
          Header { propertyName: 'n.name', propertyType: 7 }
        ],
        rows: [ [ 'U4', 'mochaeach' ], [ 'U2', 'Brainy' ] ]
      }
      

      asHDCGraphs()

      If a query retrieves HDC graphs of a graph, you can use asHDCGraphs() to convert them into a list of HDCGraph objects.

      const response = await driver.gql("SHOW HDC GRAPH ON 'hdc-server-1'");
      const hdcGraphs = response.get(0).asHDCGraphs();
      for (const hdcGraph of hdcGraphs) {
        console.log(hdcGraph)
      }
      

      HDCGraph {
        name: 'g1_hdc_full',
        graphName: 'g1',
        status: 'DONE',
        stats: '{"edge_count":4,"edge_schema":{"Follows":{"id":2,"name":"Follows","properties":[{"id":102,"name":"createdOn","sub_types":null,"type":21}]},"default":{"id":1,"name":"default","properties":null}},"node_count":5,"node_schema":{"User":{"id":2,"name":"User","properties":[{"id":101,"name":"name","sub_types":null,"type":7}]},"default":{"id":1,"name":"default","properties":null}}}',
        isDefault: 'false',
        hdcServerName: 'hdc-server-1',
        hdcServerStatus: 'ALIVE',
        config: '{"direction":"undirected","edge_schema_map":"{\\"*\\":[\\"*\\"]}","hdc_server_name":"hdc-server-1","job_type":"central","load_id":"true","node_schema_map":"{\\"User\\":[\\"name\\"],\\"default\\":[]}","orientation":"Graph","query":"query","shard_ids":[1,2,3],"update":"static"}'
      }
      HDCGraph {
        name: 'g1_hdc_nodes',
        graphName: 'g1',
        status: 'DONE',
        stats: '{"edge_count":0,"edge_schema":null,"node_count":5,"node_schema":{"User":{"id":2,"name":"User","properties":[{"id":101,"name":"name","sub_types":null,"type":7}]},"default":{"id":1,"name":"default","properties":null}}}',
        isDefault: 'false',
        hdcServerName: 'hdc-server-1',
        hdcServerStatus: 'ALIVE',
        config: '{"direction":"undirected","edge_schema_map":"{}","hdc_server_name":"hdc-server-1","job_type":"central","load_id":"true","node_schema_map":"{\\"User\\":[\\"name\\"],\\"default\\":[]}","orientation":"Graph","query":"query","shard_ids":[1,2,3],"update":"static"}'
      }
      

      asAlgos()

      If a query retrieves algorithms installed in the database, you can use asAlgos() to convert them into a list of Algo objects.

      const response = await driver.gql("SHOW HDC ALGO ON 'hdc-server-1'");
      const algos = response.get(0).asAlgos();
      for (const algo of algos) {
        if (algo.type === "algo") {
          console.log(algo.name)
        }
      }
      

      bipartite
      fastRP
      

      asProjections()

      If a query retrieves projections of a graph, you can use asProjections() to convert them into a list of Projection objects.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("SHOW PROJECTION", requestConfig);
      const projections = response.get(0).asProjections();
      for (const projection of projections) {
        console.log(projection)
      }
      

      Projection {
        name: 'distG1',
        graphName: 'g1',
        status: 'DONE',
        stats: '{"address":"xx.xx.xx.xx:xxxx","edge_count":2,"node_count":3},{"address":"xx.xx.xx.xx:xxxx","edge_count":2,"node_count":2},{"address":"xx.xx.xx.xx:xxxx","edge_count":0,"node_count":0}',
        config: '{"direction":"undirected","edges":{"*":["*"]},"load_id":1,"nodes":{"*":["*"]},"shard_ids":[1,2,3]}'
      }
      Projection {
        name: 'distG1_nodes',
        graphName: 'g1',
        status: 'DONE',
        stats: '{"address":"xx.xx.xx.xx:xxxx","edge_count":0,"node_count":3},{"address":"xx.xx.xx.xx:xxxx","edge_count":0,"node_count":2},{"address":"xx.xx.xx.xx:xxxx","edge_count":0,"node_count":0}',
        config: '{"direction":"undirected","load_id":1,"nodes":{"*":["*"]},"shard_ids":[1,2,3]}'
      }
      

      asIndexes()

      If a query retrieves node or edge indexes of a graph, you can use asIndexes() to convert them into a list of Index objects.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("SHOW NODE INDEX", requestConfig);
      const indexes = response.get(0).asIndexes();
      for (const index of indexes) {
        console.log(index)
      }
      

      Index {
        id: '1',
        name: 'User_name',
        properties: 'name(1024)',
        schema: 'User',
        status: 'DONE',
        size: undefined,
        dbType: 0
      }
      

      asPrivileges()

      If a query retrieves privileges defined in Ultipa, you can use asPrivileges() to convert them into a list of Privilege objects.

      const response = await driver.uql("show().privilege()");
      const privilieges = response.get(0).asPrivileges();
      for (const priviliege of privilieges) {
        console.log(priviliege)
      }
      

      Privilege { name: 'READ', level: 0 }
      Privilege { name: 'INSERT', level: 0 }
      ...
      Privilege { name: 'DELETE_VECTOR_SERVER', level: 1 }
      

      asPolicies()

      If a query retrieves policies (roles) defined in the database, you can use asPolicies() to convert them into a list of Policy objects.

      const response = await driver.gql("SHOW ROLE");
      const policies = response.get(0).asPolicies();
      for (const policy of policies) {
        console.log(policy)
      }
      

      Policy {
        name: 'superADM',
        systemPrivileges: [
          'REVOKE',               'GRANT',
          'ADD_VECTOR_SERVER',    'LICENSE_DUMP',
          'LICENSE_UPDATE',       'DELETE_HDC_SERVER',
          'CREATE_BACKUP',        'ADD_HDC_SERVER',
          'SHOW_META',            'SHOW_BACKUP',
          'ADD_SHARD',            'SHOW_PRIVILEGE',
          'ALTER_USER',           'SHOW_GRAPH',
          'REPLACE_SHARD',        'ALTER_GRAPH',
          'DELETE_SHARD',         'DROP_GRAPH',
          'DELETE_VECTOR_SERVER', 'DROP_USER',
          'SHOW_HDC_SERVER',      'COMPACT',
          'TOP',                  'CREATE_USER',
          'SHOW_SHARD',           'CREATE_GRAPH',
          'STAT',                 'SHOW_VECTOR_SERVER',
          'SHOW_POLICY',          'TRUNCATE',
          'KILL',                 'ALTER_POLICY',
          'CREATE_POLICY',        'DROP_POLICY',
          'SHOW_USER'
        ],
        graphPrivileges: Map(1) {
          '*' => [
            'DROP_CONSTRAINT',   'CREATE_CONSTRAINT',
            'SHOW_CONSTRAINT',   'DROP_FULLTEXT',
            'SHOW_SCHEMA',       'UPDATE',
            'ALTER_SCHEMA',      'DROP_SCHEMA',
            'ALTER_PROPERTY',    'ALGO',
            'SHOW_PROPERTY',     'UPSERT',
            'CREATE_PROPERTY',   'CREATE_FULLTEXT',
            'DELETE',            'CREATE_PROJECT',
            'DROP_PROPERTY',     'STOP_JOB',
            'READ',              'CREATE_SCHEMA',
            'SHOW_FULLTEXT',     'INSERT',
            'CREATE_INDEX',      'DROP_INDEX',
            'CLEAR_JOB',         'SHOW_INDEX',
            'DROP_HDC_GRAPH',    'LTE',
            'UFE',               'SHOW_PROJECT',
            'SHOW_JOB',          'CREATE_HDC_GRAPH',
            'DROP_PROJECT',      'CREATE_VECTOR_INDEX',
            'SHOW_HDC_GRAPH',    'COMPACT_HDC_GRAPH',
            'RELOAD_SCHEMA',     'SHOW_VECTOR_INDEX',
            'DROP_VECTOR_INDEX'
          ]
        },
        propertyPrivileges: {
          node: { read: [Array], write: [Array], deny: [] },
          edge: { read: [Array], write: [Array], deny: [] }
        },
        policies: []
      }
      Policy {
        name: 'Tester',
        systemPrivileges: [ 'ALTER_GRAPH', 'SHOW_GRAPH' ],
        graphPrivileges: Map(2) {
          'g1' => [ 'SHOW_JOB', 'SHOW_INDEX' ],
          '*' => [ 'SHOW_PROPERTY', 'READ', 'SHOW_SCHEMA' ]
        },
        propertyPrivileges: {
          node: { read: [Array], write: [], deny: [] },
          edge: { read: [Array], write: [], deny: [] }
        },
        policies: []
      }
      

      asUsers()

      If a query retrieves database users, you can use asUsers() to convert them into a list of User objects.

      const response = await driver.gql("SHOW USER");
      const users = response.get(0).asUsers();
      for (const user of users) {
        console.log(user)
      }
      

      User {
        username: 'root',
        password: undefined,
        createdTime: 1757923518,
        systemPrivileges: [
          'DELETE_VECTOR_SERVER', 'DROP_POLICY',
          'TRUNCATE',             'SHOW_POLICY',
          'SHOW_VECTOR_SERVER',   'STAT',
          'CREATE_GRAPH',         'SHOW_SHARD',
          'TOP',                  'ADD_VECTOR_SERVER',
          'SHOW_GRAPH_TYPE',      'CREATE_GRAPH_TYPE',
          'DROP_USER',            'CREATE_POLICY',
          'SHOW_HDC_SERVER',      'DROP_GRAPH_TYPE',
          'LICENSE_DUMP',         'DROP_GRAPH',
          'DELETE_SHARD',         'ALTER_GRAPH',
          'REPLACE_SHARD',        'SHOW_GRAPH',
          'SHOW_USER',            'CREATE_USER',
          'ALTER_USER',           'ALTER_POLICY',
          'SHOW_PRIVILEGE',       'KILL',
          'ADD_SHARD',            'COMPACT',
          'SHOW_BACKUP',          'SHOW_META',
          'ADD_HDC_SERVER',       'CREATE_BACKUP',
          'DELETE_HDC_SERVER',    'LICENSE_UPDATE',
          'GRANT',                'REVOKE'
        ],
        graphPrivileges: Map(1) {
          '*' => [
            'DROP_CONSTRAINT',   'CREATE_CONSTRAINT',
            'SHOW_CONSTRAINT',   'DROP_FULLTEXT',
            'SHOW_SCHEMA',       'UPDATE',
            'ALTER_SCHEMA',      'DROP_SCHEMA',
            'ALTER_PROPERTY',    'ALGO',
            'SHOW_PROPERTY',     'UPSERT',
            'CREATE_PROPERTY',   'CREATE_FULLTEXT',
            'DELETE',            'CREATE_PROJECT',
            'DROP_PROPERTY',     'STOP_JOB',
            'READ',              'CREATE_SCHEMA',
            'SHOW_FULLTEXT',     'INSERT',
            'CREATE_INDEX',      'DROP_INDEX',
            'CLEAR_JOB',         'SHOW_INDEX',
            'DROP_HDC_GRAPH',    'LTE',
            'UFE',               'SHOW_PROJECT',
            'SHOW_JOB',          'CREATE_HDC_GRAPH',
            'DROP_PROJECT',      'CREATE_VECTOR_INDEX',
            'SHOW_HDC_GRAPH',    'COMPACT_HDC_GRAPH',
            'RELOAD_SCHEMA',     'SHOW_VECTOR_INDEX',
            'DROP_VECTOR_INDEX'
          ]
        },
        propertyPrivileges: {
          node: { read: [Array], write: [Array], deny: [] },
          edge: { read: [Array], write: [Array], deny: [] }
        },
        policies: []
      }
      

      asProcesses()

      If a query retrieves processes running in the database, you can use asProcesses() to convert them into a list of Process objects.

      const response = await driver.gql("TOP");
      const processes = response.get(0).asProcesses();
      for (const process of processes) {
        console.log(process)
      }
      

      Process {
        processId: '1060719',
        processQuery: 'MATCH p = ()-{1,7}() RETURN p',
        duration: '1',
        status: 'RUNNING'
      }
      

      asJobs()

      If a query retrieves jobs of a graph, you can use asJobs() to convert them into a list of Job objects.

      const requestConfig: RequestConfig = { graph: "g1" };
      const response = await driver.gql("SHOW JOB", requestConfig);
      const jobs = response.get(0).asJobs();
      for (const job of jobs) {
        console.log(job)
      }
      

      Job {
        id: '5',
        graphName: 'g1',
        query: 'CREATE INDEX User_name ON NODE User (name)',
        type: 'CREATE_INDEX',
        errMsg: '',
        result: null,
        startTime: '2025-09-23 17:43:54',
        endTime: '2025-09-23 17:43:55',
        status: 'FINISHED',
        progress: ''
      }
      Job {
        id: '5_1',
        graphName: 'g1',
        query: '',
        type: 'CREATE_INDEX',
        errMsg: '',
        result: null,
        startTime: '2025-09-23 17:43:55',
        endTime: '2025-09-23 17:43:55',
        status: 'FINISHED',
        progress: ''
      }
      Job {
        id: '5_2',
        graphName: 'g1',
        query: '',
        type: 'CREATE_INDEX',
        errMsg: '',
        result: null,
        startTime: '2025-09-23 17:43:55',
        endTime: '2025-09-23 17:43:55',
        status: 'FINISHED',
        progress: ''
      }
      Job {
        id: '5_3',
        graphName: 'g1',
        query: '',
        type: 'CREATE_INDEX',
        errMsg: '',
        result: null,
        startTime: '2025-09-23 17:43:55',
        endTime: '2025-09-23 17:43:55',
        status: 'FINISHED',
        progress: ''
      }
      Job {
        id: '1',
        graphName: 'g1',
        query: 'CREATE HDC GRAPH g1_hdc_full ON "hdc-server-1" OPTIONS {\n' +
          '  nodes: {"*": ["*"]},\n' +
          '  edges: {"*": ["*"]},\n' +
          '  direction: "undirected",\n' +
          '  load_id: true,\n' +
          '  update: "static"\n' +
          '}',
        type: 'CREATE_HDC_GRAPH',
        errMsg: '',
        result: Map(4) {
          'edge_count' => 4,
          'edge_schema' => { Follows: [Object], default: [Object] },
          'node_count' => 5,
          'node_schema' => { User: [Object], default: [Object] }
        },
        startTime: '2025-09-23 17:29:05',
        endTime: '2025-09-23 17:29:07',
        status: 'FINISHED',
        progress: ''
      }
      Job {
        id: '1_1',
        graphName: 'g1',
        query: '',
        type: 'CREATE_HDC_GRAPH',
        errMsg: '',
        result: null,
        startTime: '2025-09-23 17:29:05',
        endTime: '2025-09-23 17:29:07',
        status: 'FINISHED',
        progress: ''
      }
      

      Full Example

      import { UltipaDriver } from "@ultipa-graph/ultipa-driver";
      import type { ULTIPA } from "@ultipa-graph/ultipa-driver/dist/types/index.js";
      import { RequestConfig } from "@ultipa-graph/ultipa-driver/dist/types/types.js";
      
      let sdkUsage = async () => {
        const ultipaConfig: ULTIPA.UltipaConfig = {
          // URI example: hosts: ["xxxx.us-east-1.cloud.ultipa.com:60010"]
          hosts: ["10.xx.xx.xx:60010"],
          username: "<username>",
          password: "<password>"
        };
      
        const driver = new UltipaDriver(ultipaConfig);
      
        const requestConfig: RequestConfig = { graph: "g1" };
        const response = await driver.gql("MATCH (n:User) RETURN n LIMIT 2", requestConfig);
        const nodes = response.alias("n").asNodes();
        for (const node of nodes) {
          console.log(node)
        };
      };
      
      sdkUsage().catch(console.error);
      
      Please complete the following information to download this book
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      Privacy Policy
      Please agree to continue.

      Copyright © 2019-2025 Ultipa Inc. – All Rights Reserved   |  Security   |  Legal Notices   |  Web Use Notices