https://github.com/toto-dev/wiredtiger-debug-tools
Collection of tools to debug and analyze MongoDB WiredTiger files
https://github.com/toto-dev/wiredtiger-debug-tools
cli json mongodb wiredtiger
Last synced: 2 months ago
JSON representation
Collection of tools to debug and analyze MongoDB WiredTiger files
- Host: GitHub
- URL: https://github.com/toto-dev/wiredtiger-debug-tools
- Owner: toto-dev
- License: gpl-3.0
- Created: 2024-06-28T09:52:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-05T22:09:31.000Z (almost 2 years ago)
- Last Synced: 2025-02-24T19:59:36.450Z (over 1 year ago)
- Topics: cli, json, mongodb, wiredtiger
- Language: Python
- Homepage:
- Size: 50.8 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WiredTiger debug tools
[](https://pypi.org/project/wiredtiger-debug-tools/)

Collection of tools to debug and analyze MongoDB WiredTiger files
# Installation
## Dependencies
In order to use the provided debug tools you need to install `wt` binary on your system.
`wt` can be compiled from wiredtiger [source](https://source.wiredtiger.com/) following [this procedure](https://source.wiredtiger.com/develop/build-posix.html) or from MongoDB [source](https://github.com/mongodb/mongo) using:
```
ninja install-wiredtiger
```
Once you have the `wt` binary, make sure to add its installation folder to your PATH environment variable.
The wiredtiger package provided in major Linux usually provides a very old version of `wt` that is not capable of processing .wt files produced in newer versions.
## Package
The `wiredtiger-debug-tools` package is available on PyPI
```
pip install wiredtiger-debug-tools
```
# Usage
## `wtd` tool
- Print list of collections contained in the `_mdb_catalog`
```
wtd list-collections
```
- Inspect content of a specific collection:
```
wtd cat local.oplog.rs
```
### With `FZF`
You can use [FZF](https://github.com/junegunn/fzf) to interactively select the the collection to open
```
wtd cat `wtd list-collections | fzf | cut -d " " -f1`
```
## CLI Autocompletion
To enable CLI auto-completion on ZSH shell run:
```
eval "$(_WTD_COMPLETE=zsh_source wtd)"
```
On Bash shell:
```
eval "$(_WTD_COMPLETE=bash_source wtd)"
```