diff --git a/docs-cn/14-reference/03-connector/cpp.mdx b/docs-cn/14-reference/03-connector/cpp.mdx index 92653955135197a626f2b7c37f0652b4e525ca06..f89adfe6aacce8ee89e5016d5fbb806f0ed71839 100644 --- a/docs-cn/14-reference/03-connector/cpp.mdx +++ b/docs-cn/14-reference/03-connector/cpp.mdx @@ -402,39 +402,6 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多 **支持版本** 该功能接口从 2.3.0.0 版本开始支持。 - ```c - #include - #include - #include - - int main() { - const char* host = "127.0.0.1"; - const char* user = "root"; - const char* passwd = "taosdata"; - - // connect to server - TAOS* taos = taos_connect(host, user, passwd, "test", 0); - - // prepare the line string - char* lines1[] = { - "stg,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000", - "stg,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833641000000" - }; - - // schema-less insert - TAOS_RES* res = taos_schemaless_insert(taos, lines1, 2, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS); - if (taos_errno(res) != 0) { - printf("failed to insert schema-less data, reason: %s\n", taos_errstr(res)); - } - - taos_free_result(res); - - // close the connection - taos_close(taos); - return (code); - } - ``` - ### 订阅和消费 API 订阅 API 目前支持订阅一张或多张表,并通过定期轮询的方式不断获取写入表中的最新数据。