Quick MongoDB Id - A simple CLI tool to generate MongoDB ObjectIds from datetime and vice versa.
cargo install --git https://github.com/EojinK1m/qmidUsage: qmid [OPTIONS] [INPUT]
Arguments:
[INPUT] Datetime or ObjectId to convert
Options:
-r, --random Generate random suffix instead of zeros
-h, --help Print help
-V, --version Print version
# No args: current time + random suffix
qmid
# Date only
qmid 20251201
qmid 2025-12-01
# Date + time (various formats)
qmid 2025120114 # hour only
qmid 202512011430 # hour + minute
qmid 20251201143000 # full
qmid 20251201T14 # with T separator
qmid 20251201T1430
qmid 20251201T143000
qmid 2025-12-01T14:30:00 # ISO format
qmid 2025-12-01T14:30:00Z # with Z suffix
# With random suffix (-r flag can be anywhere)
qmid -r 20251201
qmid 20251201 -r
qmid 20251201 --randomqmid 692cda800000000000000000
# Output: 2025-12-01T00:00:00Z$ qmid
695cb1234a1b2c3d4e5f6789
$ qmid 20251201
692cda800000000000000000
$ qmid 2025-12-01T14:30:00
692da6680000000000000000
$ qmid -r 20251201
692cda80a1b2c3d4e5f67890
$ qmid 692cda800000000000000000
2025-12-01T00:00:00ZMIT