-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Critical - P2
-
None
-
Affects Version/s: 2.0.4
-
Component/s: Internal Code, Write Ops
-
Environment:ubuntu 12.04
Linux simon-1 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux
-
ALL
I wrote a lua driver(https://github.com/bigplum/lua-resty-mongol) based on openresty(ngx_lua) project. There is an issue: http://forum.nginx.org/read.php?2,226716,226744#msg-226744
1. use lua-resty-mongol inster an embeded array, mongo shell shows ok.
The "undefined" value comes from that lua table index beginning from 1.
local t = {}
table.insert(t,
)
table.insert(t,
)
r, err = col:insert(name="dog",n="10",tab=t, nil, true)
> db.test.find()
{ "_id" : ObjectId("4fbc97e10853d55c767302f8"), "tab" : [ undefined,
,
{ "b" : "bb" }], "name" : "dog", "n" : "10" }
2. use mongo shell update to push a new value into tab, the last element of tab is overrided.
> db.test.update(
{name:"dog"}, {$push:{tab:"a5"}})
> db.test.find()
{ "_id" : ObjectId("4fbc97e10853d55c767302f8"), "n" : "10", "name" : "dog", "tab" : [ undefined,
, "a5" ] }
So, is this bug is related with the "undefined" value?