According to the documentation, LPOP should respond with nil when key does not exist [reference] , but when invoked inside lua script it respond with false (as boolean) instead.
For example:
127.0.0.1:30003> eval "return redis.call('LPOP', KEYS[1]) == false" 1 not-existing-key
(integer) 1
tested on versions 6.0.9, 6.2.5, 6.2.6
Comment From: enjoy-binbin
it is not a bug, please take a look in https://redis.io/docs/interact/programmability/lua-api/#resp2-to-lua-type-conversion
RESP2 null bulk reply and null multi bulk reply -> Lua false boolean type
RESP2 to Lua type conversion
The following type conversion rules apply to the execution's context by default as well as after calling redis.setresp(2):
[RESP2 integer reply](https://redis.io/topics/protocol#resp-integers) -> Lua number
[RESP2 bulk string reply](https://redis.io/topics/protocol#resp-bulk-strings) -> Lua string
[RESP2 array reply](https://redis.io/topics/protocol#resp-arrays) -> Lua table (may have other Redis data types nested)
[RESP2 status reply](https://redis.io/topics/protocol#resp-simple-strings) -> Lua table with a single ok field containing the status string
[RESP2 error reply](https://redis.io/topics/protocol#resp-errors) -> Lua table with a single err field containing the error string
[RESP2 null bulk reply](https://redis.io/topics/protocol#null-elements-in-arrays) and [null multi bulk reply](https://redis.io/topics/protocol#resp-arrays) -> Lua false boolean type