db drop 추가
This commit is contained in:
4
mongo.go
4
mongo.go
@ -136,6 +136,10 @@ func (mc MongoClient) Close() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mc MongoClient) Drop() error {
|
||||||
|
return mc.db.Drop(context.Background())
|
||||||
|
}
|
||||||
|
|
||||||
func (mc MongoClient) DropIndex(coll CollectionName, name string) error {
|
func (mc MongoClient) DropIndex(coll CollectionName, name string) error {
|
||||||
matchcoll := mc.Collection(coll)
|
matchcoll := mc.Collection(coll)
|
||||||
_, err := matchcoll.Indexes().DropOne(context.Background(), name)
|
_, err := matchcoll.Indexes().DropOne(context.Background(), name)
|
||||||
|
|||||||
Reference in New Issue
Block a user