0
我有這樣的結構:perl的MongoDB的複雜結構更新
{
"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" }
}
}
}
});
我哪裏錯了? Thks!
$ tbl->更新( {_id =>的MongoDB :: OID->新的(值=> 「$ ID」)},{ '$組'=> { 「位置」=> { 「 A1「=> {」state「=>」En「} } } } );謝謝!所以它是正確的! ;) – diema 2012-08-11 11:21:59