docs(node):fix node-rest example failed (#19797)
This commit is contained in:
parent
a1b402d1a1
commit
4a87a58c65
|
@ -3,18 +3,14 @@ const { options, connect } = require("@tdengine/rest");
|
||||||
async function test() {
|
async function test() {
|
||||||
options.path = "/rest/sql";
|
options.path = "/rest/sql";
|
||||||
options.host = "localhost";
|
options.host = "localhost";
|
||||||
|
options.port = 6041;
|
||||||
let conn = connect(options);
|
let conn = connect(options);
|
||||||
let cursor = conn.cursor();
|
let cursor = conn.cursor();
|
||||||
try {
|
try {
|
||||||
let res = await cursor.query("SELECT server_version()");
|
let res = await cursor.query("SELECT server_version()");
|
||||||
res.toString();
|
console.log("res.getResult()",res.getResult());
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
test();
|
test();
|
||||||
|
|
||||||
// output:
|
|
||||||
// server_version() |
|
|
||||||
// ===================
|
|
||||||
// 3.0.0.0 |
|
|
||||||
|
|
Loading…
Reference in New Issue