---
name: "Mango::BSON::Code"
section: "3pm"
platform: "linux"
package: "libmango-perl"
version: "1.30-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Mango::BSON::Code"
---

# Mango::BSON::Code(3pm)

Code type

## NAME

Mango::BSON::Code - Code type

## SYNOPSIS

```
  use Mango::BSON::Code;
  my $code = Mango::BSON::Code->new(code => 'function () {}');
```

## DESCRIPTION

Mango::BSON::Code is a container for the BSON code type used by Mango::BSON.

## ATTRIBUTES

Mango::BSON::Code implements the following attributes.

### code

```
  my $js = $code->code;
  $code  = $code->code('function () {}');
```

JavaScript code.

### scope

```
  my $scode = $code->scope;
  $code     = $code->scope({foo => 'bar'});
```

Scope.

## METHODS

Mango::BSON::Code inherits all methods from Mojo::Base.

## SEE ALSO

Mango, Mojolicious::Guides, \<http://mojolicio.us\>.
