0
我有一個字符串列表colleccion:MongoDB的 - 字符串列表對象列表
{
"_id" : "87df7fd8f7df",
"spaces" : [
"45dfsdf5646sdf44fd",
"5d4fdf885sahg6f6fg"
],
}
,我試圖用一個對象列表這樣的替換:
{
"_id" : "ytry45rty4r4y",
"spaces" : [
{
"id" : "123",
"role" : ""
},
{
"id" : "321",
"role" : ""
},
}
請幫我創建一個腳本。
請提供更多的信息。你想只是盲目地更換? –
是否要將數組中的每個字符串用作id並將角色租用爲空? –