diff --git a/migrations/20231128_jellyfish_migration/20231128_jellyfish_migration.go b/migrations/20231128_jellyfish_migration/20231128_jellyfish_migration.go index 5bd3acc9a..fc29cfd57 100644 --- a/migrations/20231128_jellyfish_migration/20231128_jellyfish_migration.go +++ b/migrations/20231128_jellyfish_migration/20231128_jellyfish_migration.go @@ -389,13 +389,10 @@ func (m *Migration) fetchAndUpdateBatch() bool { log.Printf("[id=%s] [%v]", datumID, datumUpdates) - m.updates = append(m.updates, mongo.NewUpdateOneModel().SetFilter( - bson.M{ - "_id": datumID, - "modifiedTime": dDataResult["modifiedTime"], - }).SetUpdate(bson.M{ - "$set": datumUpdates, - })) + updateOp := mongo.NewUpdateOneModel() + updateOp.SetFilter(bson.M{"_id": datumID, "modifiedTime": dDataResult["modifiedTime"]}) + updateOp.SetUpdate(datumUpdates) + m.updates = append(m.updates, updateOp) m.lastUpdatedId = datumID } return len(m.updates) > 0