BSON::Array - BSON type wrapper for a list of elements
| Use Case | Command | Description |
|---|---|---|
| đĄ Create a BSON array | my $arr = bson_array(1,2,3); | Wrap a list as a BSON array object |
| đ Get underlying Perl array | my $ref = $arr->value; | Retrieve the array reference |
| đĄī¸ Explicit typing in documents | bson_doc(key => bson_array(...)); | Prevent ambiguity between array and document |
version v1.12.2
use BSON::Types ':all';
my $array = bson_array(...);
This module provides a BSON type wrapper representing a list of elements. It is currently read-only.
Wrapping is usually not necessary as an ordinary array reference is usually sufficient. This class is helpful for cases where an array reference could be ambiguously interpreted as a top-level document container.
This software is Copyright (c) 2020 by Stefan G. and MongoDB, Inc.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Generated by phpman v4.9.25-4-g0d844aa · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-07 09:03 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format