lua-resty-mongol - table insertion

Pierre serarien at baqs.net
Tue May 22 10:59:29 UTC 2012


Hi list,

I'm currently moving into lua-resty-mongol, and I'm facing this issue:

local versions = {}
local t = {}
table.insert(t,{a = "aa"})
table.insert(t,{b = "bb"})
versions={{name="dog",container="mycontainer",tab= t}}

mongos> db.files.find({container:'mycontainer'}).pretty()
{
	"_id" : ObjectId("4fbb710018b42f60c829ae87"),
	"container" : "mycontainer",
	"tab" : [
		undefined,
		{
			"a" : "aa"
		},
		{
			"b" : "bb"
		}
	],
	"name" : "dog"
}


Why is ther "undefined" field ?

Also, pushing new info to "tab" results in resetting "tab" into new array of:
[
	undefined,
	{
		"c" : "cc"
	}
]


Did I do anything wrong or is this a bug ?


Pierre



More information about the nginx mailing list