From 88d7a41893b16ed3e29e5446741d1930da482a52 Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Thu, 24 Apr 2025 16:34:57 +0800 Subject: [PATCH] fix: data version SetVersion will add record --- tools/seq/internal/seq.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/seq/internal/seq.go b/tools/seq/internal/seq.go index 7e5d5598c..9fd352a96 100644 --- a/tools/seq/internal/seq.go +++ b/tools/seq/internal/seq.go @@ -337,7 +337,7 @@ func SetVersion(coll *mongo.Collection, key string, version int) error { ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() option := options.Update().SetUpsert(true) - filter := bson.M{"key": key, "value": strconv.Itoa(version)} + filter := bson.M{"key": key} update := bson.M{"$set": bson.M{"key": key, "value": strconv.Itoa(version)}} return mongoutil.UpdateOne(ctx, coll, filter, update, false, option) }