或...「對我來說很複雜」可能更準確。複雜的蒙戈插入
在任何情況下,我的mongod和蒙戈開放和蒙戈終端我把下面的命令:
db.err_details.insert({"error_text" : "Log has found error on inbound", "co
de" : "WM2001_0", "product" : "WM2001", "profile : ["CR" : "11999002", "sol
s" : ["run", "to", "the", "hills"]], "otherinfo" : "Contact Bob Saget"});
err_details確實存在,不是的事項。無論如何,我按下回車鍵,它會給我兩次「...」,然後退出而不插入。它在查詢語法錯誤之前就做到了這一點......但它並沒有告訴你錯誤在哪裏或錯在哪裏,而且,這次我找不到它。
如果意圖不清楚,我希望「配置文件」具有一組鍵值對,其中一個(「sols」)具有ITS OWN數組值,而不是鍵值對。
在實際上「輪廓」的光爲對象我嘗試以下:
db.err_details.insert({"error_text" : "Log has found error on inbound", "errco
de" : "WM2001_0", "product" : "WM2001", "profile" : {"CR" : "11999002", "sols" :
["run", "to", "the", "hills"]}, "otherinfo" : "Contact Bob Saget"});
這是有效的蒙戈但我想對象的數組,而不是包含與數組中的元素中的對象。
你最後的例子看起來不錯。什麼不工作? –
最後一個例子是一個很好的......減去一個缺失的「在CR之後,這就是說,這並不完全是我在尋找的概念, – PinkElephantsOnParade