orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 67 forks source link

Return Graph Data (Verticies and Edges) #435

Open adambattenburg opened 4 years ago

adambattenburg commented 4 years ago

Apologies if this is the wrong place to ask, but I haven't been able to find documentation on this anywhere. How would I get the graph data using the Node API? As in the edges and vertices?

I had a similar issue with the REST API, but looked at the network requests in the Orient Studio to do something like below.

    const params = {
        command: `${searchQuery}`,
        mode: "graph"
    };

    let response;
    const request = `http://${address}:2480/command/${databaseName}/sql/-/${numberOfNodes}`;

    try {
        response = await axios.post<any>(request, params, {
            headers: {
                Authorization: `Basic ${btoa(example)}`
            }
        });
    } catch (error) {
    }

Is there anyway to do this from the Node API? Thank you so much, and sorry for posting this basic question as in issue. I can't find the answer anywhere in my searching.