Skip to content

Commit

Permalink
modify description
Browse files Browse the repository at this point in the history
  • Loading branch information
menshibin committed Nov 26, 2024
1 parent aa49160 commit 113ee4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions nodejs/example/all_type_stmt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ async function all_type_example() {
tagParams.setVarBinary([vbData]);
await stmt.setTags(tagParams);


let bindParams = stmt.newStmtParam();
const currentMillis = new Date().getTime();
bindParams.setTimestamp([currentMillis]);
Expand Down Expand Up @@ -140,8 +139,6 @@ async function all_type_example() {

}



async function test() {
setLevel("debug")
await json_tag_example()
Expand Down
7 changes: 2 additions & 5 deletions nodejs/example/basicSchemaless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ let telnetData = "stb0_0 1626006833 4 host=host0 interface=eth0"
let jsonData = "{\"metric\": \"meter_current\",\"timestamp\": 1626846400,\"value\": 10.3, \"tags\": {\"groupid\": 2, \"location\": \"California.SanFrancisco\", \"id\": \"d1001\"}}"
const dropDB = `drop database if exists ${db}`


async function Prepare() {
let conf :WSConfig = new WSConfig(dsn)
conf.setUser('root')
conf.setPwd('taosdata')
let wsSql = await sqlConnect(conf)
const topics:string[] = ['pwer_meters_topic']
let dropTopic = `DROP TOPIC IF EXISTS ${topics[0]};`
await wsSql.exec(dropTopic);
await wsSql.exec(dropDB);

await wsSql.exec('create database if not exists power KEEP 3650 DURATION 10 BUFFER 16 WAL_LEVEL 1;');
Expand All @@ -31,7 +27,8 @@ async function Prepare() {
conf.setUser('root')
conf.setPwd('taosdata')
conf.setDb('power')
wsSchemaless = await sqlConnect(conf)
wsSchemaless = await sqlConnect(conf);
await Prepare();
await wsSchemaless.schemalessInsert([influxdbData], SchemalessProto.InfluxDBLineProtocol, Precision.NANO_SECONDS, 0);
await wsSchemaless.schemalessInsert([telnetData], SchemalessProto.OpenTSDBTelnetLineProtocol, Precision.SECONDS, 0);
await wsSchemaless.schemalessInsert([jsonData], SchemalessProto.OpenTSDBJsonFormatProtocol, Precision.SECONDS, 0);
Expand Down

0 comments on commit 113ee4d

Please sign in to comment.