afloyd / mongo-migrate

MIT License
159 stars 81 forks source link

change of value is NOT working #78

Open mohanelankuppan opened 5 years ago

mohanelankuppan commented 5 years ago

change of value is NOT working

async function changeValueMongo (db, next) { res = await db.collection('mongos').find({}).forEach(async function (mongo) { if (mongo.plan.mongoOperation && mongo.plan.mongoOperation.trip) { mongo.plan.mongoOperation.trip.forEach(function (mongoData) { if (mongoData.mongoMethod === 'mongo') { mongoData.mongoMethod = 'mongodb' } }) } await db.collection('mongos').save(mongo) }); }

During migrate the value is NOT changing in DB