0
這是MongoDB中MongoDB的錯誤,當我嘗試findandmodify
{ code:'ACBD5588',
email:'[email protected]',
object{
array_doc:[//many documents with this structure
{
code_doc:'ANCB7894',
info_doc:'....',
//etc
}
],
counting:45,
}
}
我嘗試刪除陣列內的文件結構,該文件哈斯獨有code_array所以數組中有許多文件,具有獨特的code_array,我想刪除陣列
db.collection('database').findAndModify(
{
'code':code,
'email':email,
},[],{$pull:{'object.array_doc':{'code_doc':code_doc}}},function(err,resultado)
{
裏面的文檔,但操作給了我這個錯誤
uncaught exception: findAndModifyFailed failed: { "errmsg" :
"need remove or update", "ok" : 0 }
請提供一個樣例文檔,您希望這個文檔能夠成功 - 從文章中不清楚模式是什麼。 – 2013-02-27 12:27:02
每個文檔都有一個名爲'object'的文檔數組,並且我必須在文檔內拉和推文件 – andrescabana86 2013-02-27 21:36:50
您列出的文檔不是合法的JSON。您是否錯誤地在某些字段上添加了{}?另外,我沒有看到名爲code_array的字段,但我確實看到了code_doc - 在查詢中是否有拼寫錯誤? – 2013-02-28 00:02:20