lua-resty-mongol - table insertion

bigplum nginx-forum at nginx.us
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
and
index=index+1 when read from mongodb, the "undefined" will be
eliminated.
We will found that the tab[1]=aa inserted into mongodb will be tab[0]=aa
actual
stored in mongodb, and it's conflict with other language drivers.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,226716,226744#msg-226744



More information about the nginx mailing list