Hello!
On Mon, Jul 14, 2014 at 4:05 AM, Jerome Lafon wrote:
> Can someone explain the difference between ngx.null and nil and most of all
> when should we use one rather than the other?
>
Lua tables do not allow nil "holes" among its elements and that's why
ngx.null was introduced in the first place. Also, it's mostly for
compatibility with libraries like lua-cjson.
My suggestion is: use nil or false wherever you can and only use
ngx.null when you really have to.
Regards,
-agentzh