# man > BSON::String

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

## Quick Reference
- `BSON::String->new(value => "hello")` — create a BSON string wrapper
- `bson_string("hello")` — shortcut from `BSON::Types`
- `"$obj"` or `$obj->value` — retrieve the string value
- `$obj->TO_JSON` — returns the value as a JSON string

## Name
`BSON::String` — BSON type wrapper for strings

## Synopsis
perl
use BSON::Types ':all';

my $s  = bson_string("explicit BSON string");
my $s2 = BSON::String->new(value => "another string");
## Attributes
- `value` — scalar value, stringified at construction. Default: empty string.

## Methods
- `TO_JSON` — returns the value as a string.

## Overloading
The stringification operator `""` is overloaded to return the `value`. Full minimal set of overloaded operations is provided (per `overload` documentation) and fallback overloading is enabled.

## See Also
- [BSON::Types](https://metacpan.org/pod/BSON::Types)  
- [MongoDB::BSON](https://metacpan.org/pod/MongoDB::BSON)  
- [overload](https://perldoc.perl.org/overload)