db drop 추가

This commit is contained in:
2024-06-25 10:11:02 +09:00
parent 324a7225ec
commit f4e6f8a415

View File

@ -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 {
matchcoll := mc.Collection(coll)
_, err := matchcoll.Indexes().DropOne(context.Background(), name)