# man > BSON::MinKey

---
type: CommandReference
command: BSON::MinKey
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference
- `bson_minkey()` — returns the singleton BSON MinKey value
- `$minkey->TO_JSON()` — serializes to `{"$minKey":1}` when `BSON_EXTJSON` is enabled; throws otherwise
- `use BSON::Types ':all';` — imports the function

## Name
BSON::MinKey — BSON type wrapper for MinKey

## Synopsis
perl
use BSON::Types ':all';
my $min = bson_minkey();
## Methods
- **`TO_JSON()`** — If the `BSON_EXTJSON` option is true, returns a hashref `{"$minKey":1}` per MongoDB Extended JSON. If false, throws an error because the value has no JSON representation.

## See Also
- [BSON](http://localhost/phpMan.php/perldoc/BSON/markdown)
- [BSON::Types](http://localhost/phpMan.php/perldoc/BSON::Types/markdown)