{
    "content": [
        {
            "type": "text",
            "text": "# BSON::Code (perldoc)\n\n## NAME\n\nBSON::Code - BSON type wrapper for Javascript code\n\n## SYNOPSIS\n\nuse BSON::Types ':all';\n$code = bsoncode( $javascript );\n$code = bsoncode( $javascript, $scope );\n\n## DESCRIPTION\n\nThis module provides a BSON type wrapper for the \"Javascript code\" type and the \"Javascript with\nScope\" BSON types.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ATTRIBUTES**\n- **METHODS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "BSON::Code",
        "section": "",
        "mode": "perldoc",
        "summary": "BSON::Code - BSON type wrapper for Javascript code",
        "synopsis": "use BSON::Types ':all';\n$code = bsoncode( $javascript );\n$code = bsoncode( $javascript, $scope );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "ATTRIBUTES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "BSON::Code - BSON type wrapper for Javascript code\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version v1.12.2\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use BSON::Types ':all';\n\n$code = bsoncode( $javascript );\n$code = bsoncode( $javascript, $scope );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides a BSON type wrapper for the \"Javascript code\" type and the \"Javascript with\nScope\" BSON types.\n",
                "subsections": []
            },
            "ATTRIBUTES": {
                "content": "code\nA string containing Javascript code. Defaults to the empty string.\n\nscope\nAn optional hash reference containing variables in the scope of \"code\". Defaults to \"undef\".\n",
                "subsections": []
            },
            "METHODS": {
                "content": "length\nReturns the length of the \"code\" attribute.\n\nTOJSON\nIf the \"BSONEXTJSON\" option is true, returns a hashref compatible with MongoDB's extended JSON\n<https://github.com/mongodb/specifications/blob/master/source/extended-json.rst> format, which\nrepresents it as a document as follows:\n\n{\"$code\" : \"<code>\"}\n{\"$code\" : \"<code>\", \"$scope\" : { ... } }\n\nIf the \"BSONEXTJSON\" option is false, an error is thrown, as this value can't otherwise be\nrepresented in JSON.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "*   David Golden <david@mongodb.com>\n\n*   Stefan G. <minimalist@lavabit.com>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2020 by Stefan G. and MongoDB, Inc.\n\nThis is free software, licensed under:\n\nThe Apache License, Version 2.0, January 2004\n",
                "subsections": []
            }
        }
    }
}