showGraph()
Method and interface:
showGraph(commonReq?: RequestType.RequestConfig): Promise<ULTIPA.Response<ResponseType.Graph[]>>
Example: Acquire all graphsets
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.showGraph();
console.log(resp.data);
};
sdkUsage();
getGraph()
Method and interface:
getGraph(req: RequestType.Graph,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<ResponseType.Graph>>
interface Graph {
name: string;
}
Example: Acquire graphset 'amz'
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.getGraph({ name: "amz" });
console.log(resp.data);
};
sdkUsage();
createGraph()
Method and interface:
createGraph(req: RequestType.GraphCreate,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<null>>
interface GraphCreate {
name: string;
desc?: string;
}
Example: Create graphset with name 'testGraph' and description 'graphset for test'
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.createGraph({
name: "testGraph",
desc: "graphset for test"
});
console.log(resp.status.code_desc);
};
sdkUsage();
updateGraph()
Method and interface:
updateGraph(req: RequestType.UpdateGraph,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<null>>
interface UpdateGraph {
oldGraphSetName: string;
newGraphSetName?: string;
newDesc?: string;
}
Example: Modify graphset 'testGraph' with new name 'newGraph' and new description 'rename testGraph as newGraph'
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.updateGraph({
oldGraphSetName: "testGraph",
newGraphSetName: "newGraph",
newDesc: "rename testGraph as newGraph"
});
console.log(resp.status.code_desc);
};
sdkUsage();
deleteGraph()
Method and interface:
deleteGraph(req: RequestType.Graph,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<null>>
interface Graph {
name: string;
}
Example: Delete graphset 'newGraph'
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.deleteGraph({ name: "newGraph" });
console.log(resp.status.code_desc);
};
sdkUsage();