# man > BSON::Doc

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

## Quick Reference
- `bson_doc(key => value, ...)` — create an ordered BSON document

## Name
`BSON::Doc` — BSON type wrapper for ordered documents (read-only)

## Synopsis
perl
use BSON::Types ':all';
my $ordered = bson_doc(first => 1, second => 2);
## Options
None.

## Examples
perl
# Import the function and create an ordered document
use BSON::Types ':all';
my $doc = bson_doc(name => "Alice", age => 30);
## See Also
- [BSON::Types](https://metacpan.org/pod/BSON::Types) — BSON type wrappers and the `bson_doc()` function
- [BSON](https://metacpan.org/pod/BSON) — main BSON module