[GODRIVER-1732] As a developer, I would like to know the mongo version, so I can enable specific feature paths if available. Created: 29/Aug/20 Updated: 01/Sep/20 Resolved: 01/Sep/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | API |
| Affects Version/s: | 1.4.0, 1.3.7 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Matt Hartstonge | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I would like an API that exposes the mongoDB version being worked with. For example, for critical paths that require atomicity I would like the application to be able to know what version of mongo we are connected to so I can use the transaction API, or fall back to primary preferred, majority write. I started hacking away with the transactions API which unexpectedly failed miserably with a mongo serialization error on Mongo 3.6. Coming from the mgo driver, which has a transaction API, I inadvertently expected the mongo-driver API to also work for 3.6.
|
| Comments |
| Comment by Divjot Arora (Inactive) [ 01/Sep/20 ] | |||||||||||||
|
matt.hartstonge@gmail.com Great! If that's sufficient for your use case, I'm going to close out this ticket. Feel free to leave another comment or open a new ticket if you have any other questions. – Divjot | |||||||||||||
| Comment by Matt Hartstonge [ 01/Sep/20 ] | |||||||||||||
|
Hi @divjot, yes, I can build on top of that. � | |||||||||||||
| Comment by Divjot Arora (Inactive) [ 31/Aug/20 ] | |||||||||||||
|
You can get this information by running the buildInfo command (https://docs.mongodb.com/manual/reference/command/buildInfo/) via the RunCommand API:
Does this satisfy your use case? – Divjot | |||||||||||||
| Comment by Matt Hartstonge [ 30/Aug/20 ] | |||||||||||||
|
Only way to get this information seems to be via the mongo shell: https://docs.mongodb.com/manual/reference/method/db.version/ |