From 83289b761261678018a73a8f0d65f77fde116cde Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Wed, 9 Jul 2014 21:07:26 +0800 Subject: [PATCH] bugfix: Issue #133 --- lualib-src/lua-mongo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lualib-src/lua-mongo.c b/lualib-src/lua-mongo.c index 3e4666dc..855cc385 100644 --- a/lualib-src/lua-mongo.c +++ b/lualib-src/lua-mongo.c @@ -506,7 +506,7 @@ op_insert(lua_State *L) { int i; for (i=1;i<=s;i++) { lua_rawgeti(L,3,i); - document doc = lua_touserdata(L,3); + document doc = lua_touserdata(L,-1); luaL_addlstring(&b, (const char *)doc, get_length(doc)); lua_pop(L,1); }