MongoDB::BSON - Encoding and decoding utilities (more to come)
$MongoDB::BSON::char = ":"; $collection->query({"x" => {":gt" => 4}});
Can be used to set a character other than "$" to use for special operators.
# turn off utf8 flag on strings $MongoDB::BSON::utf8_flag_on = 0;
Default is turn on, that compatible with version before 0.34.
If set to 0, will turn of utf8 flag on string attribute and return on bytes mode, meant same as :
utf8::encode($str)
Currently MongoDB return string with utf8 flag, on character mode , some people wish to turn off utf8 flag and return string on byte mode, it maybe help to display "pretty" strings.
NOTE:
If you turn off utf8 flag, the string length will compute as bytes, and is_utf8 will return false.
$MongoDB::BSON::use_boolean = 1
By default, booleans are deserialized as integers. If you would like them to be deserialized as "true" in boolean and "false" in boolean, set $MongoDB::BSON::use_boolean to 1.
$MongoDB::BSON::use_boolean
To install MongoDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MongoDB
CPAN shell
perl -MCPAN -e shell install MongoDB
For more information on module installation, please visit the detailed CPAN module installation guide.