Skip to content

Commit

Permalink
get mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
smallfish committed May 12, 2021
1 parent e0e04cb commit 23266e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xmongo/new_mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func NewMongoCollection(coll string) *mongo.Collection {
return mongoDB.Collection(coll)
}

func GetMongoDB() *mongo.Database {
return mongoDB
}

func CloseMongo() error {
if client == nil {
return errors.New("mongo client invalid")
Expand Down

0 comments on commit 23266e0

Please sign in to comment.