Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timed queries run in the taos (tdengine shell client) and return data correctlly, but run in NodeJS but return an empty data list #53

Open
mjk14 opened this issue Apr 23, 2024 · 0 comments

Comments

@mjk14
Copy link

mjk14 commented Apr 23, 2024

Hi. I want to select all rows of a super table in Tdengine that they're between a specific time range. but when I run the query, in node.js app returns empty data but when I execute the query in taos (Tdengine shell), returns the right and complete data for me. what's wrong?

const queryFormatStr = ' SELECT * FROM test_super_table WHERE createdAt BETWEEN "2024-04-23 09:25:24.453" AND "2024-04-23 10:25:24.453" ';
const conn = taos.connect({
host: AppConfig().timeseriesDb.host,
user: AppConfig().timeseriesDb.user,
password: AppConfig().timeseriesDb.password,
config: AppConfig().timeseriesDb.config,
port: AppConfig().timeseriesDb.port,
});
const cursor = conn.cursor()
const query = cursor.query(queryFormatStr);
const result = await query.execute();
console.log(result.data);

my Node.js version: 20.11.0

tip1: Both timezone are set on Asia/Tehran.
tip2: Nodejs app and tdengine are two docker container.
tip3: When i don't use times (SELECT * FROM test_super_table) everything is ok in two methods.
tip4: Sometimes when the time difference of the specified interval is more than 3.5 hour , the NodeJS client returns the correct data.
@sangshuduo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant