Skip to content

Commit

Permalink
fix update op
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Dec 18, 2023
1 parent 1beaf76 commit f79a32f
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f79a32f

Please sign in to comment.