MongoDB::Connection - A connection to a Mongo server
version 0.01
Hostname to connect to. Defaults to loalhost.
loalhost
Port to use when connecting. Defaults to 27017.
27017
Boolean indicating whether or not to reconnect if the connection is interrupted. Defaults to 0.
0
Boolean indication whether or not to connect automatically on object construction. Defaults to 1.
1
$connection->connect;
Connects to the mongo server. Called automatically on object construction if auto_connect is true.
auto_connect
my @dbs = $connection->database_names;
Lists all databases on the mongo server.
my $database = $connection->get_database('foo');
Returns a MongoDB::Database instance for database with the given $name.
MongoDB::Database
$name
$connection->authenticate('foo', 'username', 'secret');
Attempts to authenticate for use of the $dbname database with $username and $password. Passwords are expected to be cleartext and will be automatically hashed before sending over the wire, unless $is_digest is true, which will assume you already did the hashing on yourself.
$dbname
$username
$password
$is_digest
Florian Ragwitz <rafl@debian.org>
This software is Copyright (c) 2009 by 10Gen.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
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.