mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-07-25 09:15:39 +08:00
Compare commits
2 Commits
c4bf4501ae
...
632d55c8b2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
632d55c8b2 | ||
|
|
91db18168d |
@ -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)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user