{
    "content": [
        {
            "type": "text",
            "text": "# BSON::Types (perldoc)\n\n## NAME\n\nBSON::Types - Helper functions to wrap BSON type classes\n\n## SYNOPSIS\n\nuse BSON::Types ':all';\n$int32   = bsonint32(42);\n$double  = bsondouble(3.14159);\n$decimal = bsondecimal(\"24.01\");\n$time    = bsontime(); # now\n...\n\n## DESCRIPTION\n\nThis module provides helper functions for BSON type wrappers. Type wrappers use objects\ncorresponding to BSON types to represent data that would have ambiguous type or don't have a\nnative Perl representation\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **FUNCTIONS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "BSON::Types",
        "section": "",
        "mode": "perldoc",
        "summary": "BSON::Types - Helper functions to wrap BSON type classes",
        "synopsis": "use BSON::Types ':all';\n$int32   = bsonint32(42);\n$double  = bsondouble(3.14159);\n$decimal = bsondecimal(\"24.01\");\n$time    = bsontime(); # now\n...",
        "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": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 123,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "BSON::Types - Helper functions to wrap BSON type classes\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version v1.12.2\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use BSON::Types ':all';\n\n$int32   = bsonint32(42);\n$double  = bsondouble(3.14159);\n$decimal = bsondecimal(\"24.01\");\n$time    = bsontime(); # now\n...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides helper functions for BSON type wrappers. Type wrappers use objects\ncorresponding to BSON types to represent data that would have ambiguous type or don't have a\nnative Perl representation\n\nFor example, because Perl scalars can represent strings, integers or floating point numbers, the\nserialization rules depend on various heuristics. By wrapping a Perl scalar with a class, such\nas BSON::Int32, users can specify exactly how a scalar should serialize to BSON.\n",
                "subsections": []
            },
            "FUNCTIONS": {
                "content": "bsonbytes\n$bytes = bsonbytes( $bytestring );\n$bytes = bsonbytes( $bytestring, $subtype );\n\nThis function returns a BSON::Bytes object wrapping the provided string. A numeric subtype may\nbe provided as a second argument, but this is not recommended for new applications.\n\nbsoncode\n$code = bsoncode( $javascript );\n$code = bsoncode( $javascript, $hashref );\n\nThis function returns a BSON::Code object wrapping the provided Javascript code. An optional\nhashref representing variables in scope for the function may be given as well.\n\nbsondbref\n$dbref = bsondbref( $objectid, $collectionname );\n\nThis function returns a BSON::DBRef object wrapping the provided Object ID and collection name.\n\nbsondecimal128\n$decimal = bsondecimal128( \"0.12\" );\n$decimal = bsondecimal128( \"1.23456789101112131415116E-412\" );\n\nThis function returns a BSON::Decimal128 object wrapping the provided decimal string. Unlike\nfloating point values, this preserves exact decimal precision.\n\nbsondoc\n$doc = bsondoc( first => \"hello, second => \"world\" );\n\nThis function returns a BSON::Doc object, which preserves the order of the provided key-value\npairs.\n\nbsonarray\n$doc = bsonarray(...);\n\nThis function returns a BSON::Array object, which preserves the order of the provided list of\nelements.\n\nbsondouble\n$double = bsondouble( 1.0 );\n\nThis function returns a BSON::Double object wrapping a native double value. This ensures it\nserializes to BSON as a double rather than a string or integer given Perl's lax typing for\nscalars.\n\nbsonint32\n$int32 = bsonint32( 42 );\n\nThis function returns a BSON::Int32 object wrapping a native integer value. This ensures it\nserializes to BSON as an Int32 rather than a string or double given Perl's lax typing for\nscalars.\n\nbsonint64\n$int64 = bsonint64( 0 ); # 64-bit zero\n\nThis function returns a BSON::Int64 object, wrapping a native integer value. This ensures it\nserializes to BSON as an Int64 rather than a string or double given Perl's lax typing for\nscalars.\n\nbsonmaxkey\n$maxkey = bsonmaxkey();\n\nThis function returns a singleton representing the \"maximum key\" BSON type.\n\nbsonminkey\n$minkey = bsonminkey();\n\nThis function returns a singleton representing the \"minimum key\" BSON type.\n\nbsonoid\n$oid = bsonoid();         # generate a new one\n$oid = bsonoid( $bytes ); # from 12-byte packed OID\n$oid = bsonoid( $hex   ); # from 24 hex characters\n\nThis function returns a BSON::OID object wrapping a 12-byte MongoDB Object ID. With no\narguments, a new, unique Object ID is generated instead. If 24 hexadecimal characters are given,\nthey will be packed into a 12-byte Object ID.\n\nbsonraw\n$raw = bsonraw( $bsonencoded );\n\nThis function returns a BSON::Raw object wrapping an already BSON-encoded document.\n\nbsonregex\n$regex = bsonregex( $pattern );\n$regex = bsonregex( $pattern, $flags );\n\nThis function returns a BSON::Regex object wrapping a PCRE pattern and optional flags.\n\nbsonstring\n$string = bsonstring( \"08544\" );\n\nThis function returns a BSON::String object, wrapping a native string value. This ensures it\nserializes to BSON as a UTF-8 string rather than an integer or double given Perl's lax typing\nfor scalars.\n\nbsontime\n$time = bsontime( $secondsfromepoch );\n\nThis function returns a BSON::Time object representing a UTC date and time to millisecond\nprecision. The argument must be given as a number of seconds relative to the Unix epoch\n(positive or negative). The number may be a floating point value for fractional seconds. If no\nargument is provided, the current time from Time::HiRes is used.\n\nbsontimestamp\n$timestamp = bsontimestamp( $secondsfromepoch, $increment );\n\nThis function returns a BSON::Timestamp object. It is not recommended for general use.\n\nbsonbool (DISCOURAGED)\n# for consistency with other helpers\n$bool = bsonbool( $expression );\n\n# preferred for efficiency\nuse boolean;\n$bool = boolean( $expression );\n\nThis function returns a boolean object (true or false) based on the provided expression (or\nfalse if no expression is provided). It is provided for consistency so that all BSON types have\na corresponding helper function.\n\nFor efficiency, use \"boolean::boolean()\" directly, instead.\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": []
            }
        }
    }
}