假设我收集了以下数据。
{
_id: ObjectID(....),
...
data : [ 23, 34]
}我有以下JavaScript函数。
function reduce(array){
//some computation
return result; // not array
}是否有任何方法使用MongoDB shell更新所有集合,具有以下净效果。
{
data : reduce(data)
}编辑:
作为迁移的一部分,我只想执行一次。
https://stackoverflow.com/questions/29428622
复制相似问题