perf(database): change _id field to url

BREAKING CHANGE: YOU MUST CHANGE `_id` TO `url` AND GENERATE ObjectID to `_id` IN MONGODB.
This commit is contained in:
Medzik 2021-09-08 20:31:59 +00:00
parent 5ebc9a5b0a
commit 8f64eb1dcb
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,9 @@
package mongo
import "go.mongodb.org/mongo-driver/bson/primitive"
type URL struct {
URL string `bson:"_id,omitempty" json:"url,omitempty"`
Cluster int `bson:"cluster,omitempty" json:"cluster,omitempty"`
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
URL string `bson:"url,omitempty" json:"url,omitempty"`
Cluster int `bson:"cluster,omitempty" json:"cluster,omitempty"`
}

View File

@ -40,5 +40,7 @@ func StopAfterPing() {
break
}
time.Sleep(100 * time.Millisecond) // 0.1 second
}
}