GithubHelp home page GithubHelp logo

Comments (6)

bjoe2k4 avatar bjoe2k4 commented on August 17, 2024 4

Quote from the lua-resty-redis documentation:

A nil bulk reply results in a ngx.null return value.

Therefore you need to check against ngx.null:

if val == ngx.null then
    ngx.say("the value is not exists.")
else 
    ngx.say("val: "..val)
end

from lua-resty-redis.

pbby avatar pbby commented on August 17, 2024

Thank you for reply, I'm sorry have not focus on it.
I test it and it worked.

from lua-resty-redis.

bjoe2k4 avatar bjoe2k4 commented on August 17, 2024

can you close the issue?

from lua-resty-redis.

Habbie avatar Habbie commented on August 17, 2024

(I understand I'm commenting on a closed issue which may mean nobody will remember to respond to this, will try harder later).

README.markdown has this snippet:

                local res, err = red:get("dog")
                if not res then
                    ngx.say("failed to get dog: ", err)
                    return
                end

and that's how I ran into this 'issue' as well. Is the README indeed wrong? Want me to submit a patch for it?

from lua-resty-redis.

agentzh avatar agentzh commented on August 17, 2024

No, the doc is correct and precise. Look more carefully.

from lua-resty-redis.

agentzh avatar agentzh commented on August 17, 2024

nil is returned for fatal errors like network problems, which is apparently a different thing.

from lua-resty-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.