mongosh 0.2.3

A high-performance MongoDB Shell implementation in Rust
Documentation
# Changelog

All notable changes to this project will be documented in this file.

## [0.2.3] - 2025-12-18

### Added

- **Projection support** - Implemented field projection for query results to control which fields are returned
- **MongoDB 4.0+ compatibility** - Locked MongoDB driver version to 3.2.5 for better compatibility with MongoDB 4.0 and later versions

## [0.2.2] - 2025-12-17

### Added

- **Runtime configuration commands** - `format`, `color`, and `config` commands for changing output settings in REPL
- **Table formatter** - New table output format using tabled crate for MongoDB documents
- **Configurable JSON indentation** - Customizable indentation levels for JSON output
- **`count()` alias** - Added as alias for `countDocuments()` for convenience

### Changed

- **Rust edition updated to 2024**
- Refactored CLI argument handling into separate method for better code organization
- Refactored colorizer and shell formatter for BSON types
- Enforced minimum server selection timeout and direct connection for single hosts

### Removed

- Script mod removed from codebase

## [0.2.1] - 2025-12-16

### Changed

- **Default log level changed to WARN** - Cleaner interactive mode output, INFO logs only shown with `--verbose`
- `find()` results now displayed as array format - Matches MongoDB shell behavior

### Fixed

- Removed duplicate connection logging messages
- Fixed redundant error message prefixes (e.g., "Parse error: Parse error:")
- Removed extra blank line after connection banner

## [0.2.0] - 2025-12-16

### Added

- **AST-based parser using Oxc** - Complete rewrite replacing regex-based parsing
- **Chained method call support** - `.limit()`, `.skip()`, `.sort()`, `.projection()`, `.batchSize()`
- **Write operations** - Full implementation of `insertOne`, `insertMany`, `updateOne`, `updateMany`, `deleteOne`, `deleteMany`
- MongoDB-specific type constructors: `ObjectId()`, `ISODate()`, `NumberInt()`, `NumberLong()`, `NumberDecimal()`
- New query commands: `ReplaceOne`, `EstimatedDocumentCount`, `FindOneAndDelete`, `FindOneAndUpdate`, `FindOneAndReplace`, `Distinct`, `BulkWrite`
- Extended admin commands: `ShowUsers`, `ShowRoles`, `ShowProfile`, `ShowLogs`, `ServerStatus`, `CurrentOp`, `KillOp`, etc.
- Enhanced options support for find, update, aggregate, and findAndModify operations
- Result formatting for write operations in shell and JSON formats

### Changed

- **Refactored executor module** - Split into separate files: `context.rs`, `result.rs`, `router.rs`, `query.rs`, `admin.rs`, `utility.rs`
- Refactored parser into modular architecture (`command.rs`, `db_operation.rs`, `expr_converter.rs`, `shell_commands.rs`)
- `QueryCommand::Count` renamed to `QueryCommand::CountDocuments`

### Fixed

- Complex nested queries and MongoDB operators now parse correctly
- Proper handling of negative numbers, arrays, and nested objects
- Database name validation follows MongoDB naming rules

## [0.1.2] - 2025-12-15

### Added

- `findOne` command support with filter and projection options
- Shell-style output formatting (mongosh compatible)
- Simplified JSON format for programmatic use
- CLI `--format` argument support (shell, json, json-pretty, table, compact)

### Changed

- **Refactored formatter module into separate files for better maintainability**

### Fixed

- **JSON compact format now outputs single-line JSON without colorization**
- CLI arguments (e.g., `--format`, `--no-color`) now properly override configuration defaults
- Tab completion no longer causes panic in REPL

## [0.1.1] - 2025-12-12

### Fixed

- REPL prompt now updates correctly after `use <database>` command

### Added

- `--host` and `--port` CLI parameters for MongoDB connection
- Complete connection URI building from CLI arguments

### Changed

- Refactored state management using `SharedState` pattern
- Eliminated manual state synchronization (breaking change)
- Reduced memory overhead and unnecessary clone operations

## [0.1.0] - 2025-12-08

### Added

- Initial release of mongosh - MongoDB Shell in Rust
- Interactive REPL mode with history and multi-line support
- Script execution (`--file`, `--eval`)
- MongoDB connection management with auto-reconnection
- CRUD, admin, and utility commands
- Multiple output formats (JSON, table)
- Configuration system and plugin architecture
- TLS/SSL and authentication support