Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mongodb::bson(3pm) [debian man page]

MongoDB::BSON(3pm)					User Contributed Perl Documentation					MongoDB::BSON(3pm)

NAME
MongoDB::BSON - Encoding and decoding utilities (more to come) ATTRIBUTES
"looks_like_number" $MongoDB::BSON::looks_like_number = 1; $collection->insert({age => "4"}); # stores 4 as an int If this is set, the driver will be more aggressive about converting strings into numbers. Anything that Scalar::Util's looks_like_number would approve as a number will be sent to MongoDB as its numeric value. Defaults to 0 (for backwards compatibility). If you do not set this, you may be using strings more often than you intend to. See the MongoDB::DataTypes section for more info on the behavior of strings vs. numbers. char $MongoDB::BSON::char = ":"; $collection->query({"x" => {":gt" => 4}}); Can be used to set a character other than "$" to use for special operators. Turn on/off UTF8 flag when return strings # 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. Return boolean values as booleans instead of integers $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. perl v5.14.2 2011-09-07 MongoDB::BSON(3pm)

Check Out this Related Man Page

MONGODBDRIVERMANAGER.__CONSTRUCT(3)					 1				       MONGODBDRIVERMANAGER.__CONSTRUCT(3)

MongoDBnager::__construct - Create new MongoDB Manager

SYNOPSIS
finalpublic MongoDBDriverManager::__construct (string $uri, [array $options], [array $driverOptions]) DESCRIPTION
Constructs a new MongoDBDriverManager object with the specified options. PARAMETERS
o $uri - A mongodb:// connection URI: mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] o $options -Connection string options. Note Specifying options via the $options argument will overwrite any options with the same name in the $uri argument. o $driverOptions - Any driver-specific options not included in MongoDB connection spec. ERRORS
/EXCEPTIONS oThrows InvalidArgumentException on argument parsing errors. oThrows MongoDBDriverRuntimeException if the $uri format is invalid EXAMPLES
Example #1 MongoDBDriverManager.__construct(3) basic examples Connecting to standalone MongoDB node <?php $manager = new MongoDBDriverManager("mongodb://localhost:27017"); ?> Connecting to a replica set <?php $manager = new MongoDBDriverManager("mongodb://rs1.example.com,rs2.example.com/?replicaSet=myReplicaSet"); ?> Connecting to a sharded cluster (i.e. one or more mongos instances) <?php $manager = new MongoDBDriverManager("mongodb://mongos1.example.com,mongos2.example.com/"); ?> Connecting to MongoDB with authentication credentials for a particular user and database. <?php $manager = new MongoDBDriverManager("mongodb://myusername:mypassword@localhost:27017/mydatabase"); ?> SEE ALSO
MongoDBDriverServer::__construct, "Chapter#2 Connecting to MongoDB", Connection string URI format. PHP Documentation Group MONGODBDRIVERMANAGER.__CONSTRUCT(3)
Man Page