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

What is the best way to check if result is empty? #88

Open
Gabb1995 opened this issue Apr 8, 2019 · 1 comment
Open

What is the best way to check if result is empty? #88

Gabb1995 opened this issue Apr 8, 2019 · 1 comment

Comments

@Gabb1995
Copy link

Gabb1995 commented Apr 8, 2019

What is the best way to check if result returned by :query is empty?

Atm I'm doing if not res or cjson.encode(res) == '{}' then but I feel that having to import cjson is too much, is there a more direct way without changing res to string?

@decadence
Copy link

What's wrong with if #result == 0?

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

2 participants