mongodb / mongodb/support-tools
getMongoData.js - Support for mongosh and MongoDB v6.X
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 140
- Forks
- 154
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 2
Description
The legacy "mongo" shell is no longer available for download, and officially deprecated as of MongoDB 6.0. As the "getMongoData.js" exists today, it breaks under two known conditions:
- "hostname()" is no longer a supported command in mongosh. Use "os.hostname()" instead.
- MDB 6.0 has deprecated "db.printSlaveReplicationInfo()". Use "db.printSecondaryReplicationInfo()" instead.
I have cloned and modified the existing script to support mongosh and MDB 6.0, you can find it and the revisions here:
https://gist.github.com/TravWill-Mongo/1bb4fdbac8a4491cb2f1d76c77afba9a
For this to be properly integrated, we would need to have some conditional logic to use the right commands based upon version.
For what it's worth, I have only tested this on the following setup:
- mongosh 1.6.1
- mongod - 6.0.1
- Operating System: Mac OS X 12.6.1
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with getMongoData.js and compare its current hostname() and db.printSlaveReplicationInfo() calls with the revisions in the linked gist. Determine how the script should select commands for legacy mongo versus mongosh and MongoDB 6.x, then verify the supported combinations; done means the tool works under both command environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100