我有这个结构:
{
"user" => "xxxx",
"position" =>
{
"A1" => { "state" => 'It', region=>"LOM" etc etc..},
"A2" => { .... },
"A3" => { .... },
....
"An" => { .. }
}
}
插入没问题。但更新返回此错误:
not a reference at /usr/local/lib/perl/5.12.4/MongoDB/Collection.pm line 376
我的更新是:
$tbl->update({
{ _id => MongoDB::OID->new(value => "$id") },
{ '$set' =>
{
"position" =>
{
"A1" => { "state" => "En" }
}
}
}
});
我哪里错了?谢谢!