lua-resty-mongol - table insertion

bigplum nginx-forum at
Wed May 23 06:22:36 UTC 2012

I found this problem before, but I'm not sure how to modify it. The
reason is:

Lua table index is begin from 1, but array in mongodb is 0. So there
will be a
undefined element in mongodb array whose index is 0.

If we modify the driver to make index=index-1 when insert into mongodb
index=index+1 when read from mongodb, the "undefined" will be
We will found that the tab[1]=aa inserted into mongodb will be tab[0]=aa
stored in mongodb, and it's conflict with other language drivers.

Posted at Nginx Forum:,226716,226744#msg-226744

More information about the nginx mailing list