Mongo命令批量更新某一数组字段的顺序

 

db.table.find().forEach(function (doc) {

    var oldValue = doc.Column1;

    var newValue = [sa[1],sa[0],sa[2]];

    db.table.update({_id: doc._id}, { $set: { Column1: newValue } });

})

原文地址:https://www.cnblogs.com/time-is-life/p/5489770.html