diff --git a/document_internals.go b/document_internals.go index c056d98..51a96cf 100644 --- a/document_internals.go +++ b/document_internals.go @@ -201,7 +201,7 @@ func incrementTagged(item interface{}) interface{} { } } 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() diff --git a/registry.go b/registry.go index 5dc0423..d4e5023 100644 --- a/registry.go +++ b/registry.go @@ -370,7 +370,7 @@ func innerWatch(coll *mongo.Collection) { counterColl := DB.Collection(COUNTER_COL) counterColl.UpdateOne(context.TODO(), bson.M{"collection": coll.Name()}, bson.M{"$set": bson.M{ "current": uid, - }}, options.Update().SetUpsert(true)) + }}, options.UpdateOne().SetUpsert(true)) } fmt.Printf("%v\n", data)