Skip to content

Commit

Permalink
Merge pull request #170 from zhb127/fix/remove_transaction_allowed_check
Browse files Browse the repository at this point in the history
fix: DoTransaction remove transactionAllowed
  • Loading branch information
jiangz222 authored May 14, 2021
2 parents 4d039cd + 6f2e68f commit 9dca033
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,16 @@ func (c *Client) DoTransaction(ctx context.Context, callback func(sessCtx contex

// ServerVersion get the version of mongoDB server, like 4.4.0
func (c *Client) ServerVersion() string {
var serverStatus bson.Raw
var buildInfo bson.Raw
err := c.client.Database("admin").RunCommand(
context.Background(),
bson.D{{"serverStatus", 1}},
).Decode(&serverStatus)
bson.D{{"buildInfo", 1}},
).Decode(&buildInfo)
if err != nil {
fmt.Println("run command err", err)
return ""
}
v, err := serverStatus.LookupErr("version")
v, err := buildInfo.LookupErr("version")
if err != nil {
fmt.Println("look up err", err)
return ""
Expand Down

0 comments on commit 9dca033

Please sign in to comment.