fix compile errors caused by mongo driver API changes

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-03-26 20:16:04 -04:00
parent 8668e89991
commit 1c18fc2bf6
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C
2 changed files with 2 additions and 2 deletions

View File

@ -201,7 +201,7 @@ func incrementTagged(item interface{}) interface{} {
} }
} }
counterColl := DB.Collection(COUNTER_COL) counterColl := DB.Collection(COUNTER_COL)
counterColl.UpdateOne(context.TODO(), bson.M{"collection": incTag.Name}, bson.M{"$set": bson.M{"collection": incTag.Name, "current": cur.Interface()}}, options.Update().SetUpsert(true)) counterColl.UpdateOne(context.TODO(), bson.M{"collection": incTag.Name}, bson.M{"$set": bson.M{"collection": incTag.Name, "current": cur.Interface()}}, options.UpdateOne().SetUpsert(true))
} }
return rv.Elem().Interface() return rv.Elem().Interface()

View File

@ -370,7 +370,7 @@ func innerWatch(coll *mongo.Collection) {
counterColl := DB.Collection(COUNTER_COL) counterColl := DB.Collection(COUNTER_COL)
counterColl.UpdateOne(context.TODO(), bson.M{"collection": coll.Name()}, bson.M{"$set": bson.M{ counterColl.UpdateOne(context.TODO(), bson.M{"collection": coll.Name()}, bson.M{"$set": bson.M{
"current": uid, "current": uid,
}}, options.Update().SetUpsert(true)) }}, options.UpdateOne().SetUpsert(true))
} }
fmt.Printf("%v\n", data) fmt.Printf("%v\n", data)