我試圖做一個批量更新有以下MongoDB的mongoimport UPSERT
mongoimport -d my_db -c db_collection -upsertFields email ~/Desktop/update_list.csv
,我試圖導入看起來像這樣的CSV。
email, full_name
[email protected],stackoverflow
[email protected],mongodb
它應該檢查電子郵件列作爲查詢arg並相應地更新全名。但是,沒有導入,它遇到錯誤。
exception:Failure parsing JSON string near: [email protected]
[email protected],abc
imported 0 objects
encountered 99398 errors
問題在哪裏?我應該怎麼做呢?
我重新保存了我的csv,所以我的數據都是雙引號。我設法讓它全部導入,但沒有更新。我最終有重複。 – crayfish 2011-02-07 05:09:21