mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-25 12:42:12 +08:00
Merge branch 'openimsdk:main' into fix/tool-struct
This commit is contained in:
commit
495faf7cb7
@ -337,7 +337,7 @@ func SetVersion(coll *mongo.Collection, key string, version int) error {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
option := options.Update().SetUpsert(true)
|
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)}}
|
update := bson.M{"$set": bson.M{"key": key, "value": strconv.Itoa(version)}}
|
||||||
return mongoutil.UpdateOne(ctx, coll, filter, update, false, option)
|
return mongoutil.UpdateOne(ctx, coll, filter, update, false, option)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user