例如,我想通過對象id顛倒一個json數組。讓我們說我有這樣的JSON數組:Json.net:按對象合併兩個json數組Id
[{"Id":"1", "a":"1", "b":"2"},
{"Id":"2", "a":"3", "b":"1"},
{"Id":"3", "a":"5", "b":"1"}]
而且我想這個陣列
[{"Id":"1", "a":"32", "b":"42"},
{"Id":"2", "a":"3", "b":"1", "c":"23"},
{"Id":"12", "a":"12", "b":"45"}]
到UPSERT它預期的結果應該是:
[{"Id":"1", "a":"32", "b":"42"},
{"Id":"2", "a":"3", "b":"1", "c":"23"},
{"Id":"3", "a":"5", "b":"1"},
{"Id":"12", "a":"12", "b":"45"}]
MongoDB在哪裏適合圖片? – 2015-03-25 11:45:57
雖然我們在這裏,對象2的c = 23屬性來自哪裏? – 2015-03-25 11:48:10
http://stackoverflow.com/questions/13588342/can-mongo-upsert-array-data – 2015-03-25 11:50:02