MongoDB - Official MongoDB Driver for Perl
version v0.704.3.0
use MongoDB; my $client = MongoDB::MongoClient->new(host => 'localhost', port => 27017); my $database = $client->get_database( 'foo' ); my $collection = $database->get_collection( 'bar' ); my $id = $collection->insert({ some => 'data' }); my $data = $collection->find_one({ _id => $id });
This is the official Perl driver for MongoDB. MongoDB is an open-source document database that provides high performance, high availability, and easy scalability.
A MongoDB server (or cluster) hosts a number of databases. A database holds a set of collections. A collection holds a set of documents. A document is a set of key-value pairs. Documents have dynamic schema. Dynamic schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in a collection's documents may hold different types of data.
Here are some resources for learning more about MongoDB:
MongoDB Manual
MongoDB CRUD Introduction
MongoDB Data Modeling Introductions
For getting started with the Perl driver, see these pages:
MongoDB Perl Driver Tutorial
MongoDB Perl Driver Examples
Extensive documentation and support resources are available via the MongoDB community website.
The MongoDB driver is organized into a set of classes representing different levels of abstraction and functionality.
As a user, you first create and configure a MongoDB::MongoClient object to connect to a MongoDB server (or cluster). From that client object, you can get a MongoDB::Database object for interacting with a specific database.
From a database object you can get a MongoDB::Collection object for CRUD operations on that specific collection, or a MongoDB::GridFS object for working with an abstract file system hosted on the database. Each of those classes may return other objects for specific features or functions.
See the documentation of those classes for more details or the MongoDB Perl Driver Tutorial for an example.
The following low-level functions are deprecated and will be removed in a future release.
write_insert
write_query
write_update
write_remove
read_documents
Starting with MongoDB v0.704.0.0, the driver will be using a modified semantic versioning scheme.
Versions will have a vX.Y.Z.N tuple scheme with the following properties:
vX.Y.Z.N
X will be incremented for incompatible API changes
X
Y will be incremented for new functionality that is backwards compatible
Y
Z will be incremented for backwards-compatible bug fixes
Z
N will be zero for a stable release; N will be non-zero for development releases
N
We use N because CPAN does not support pre-release version labels (e.g. "-alpha1") and requires non-decreasing version numbers for releases.
When N is non-zero, X, Y, and Z have no semantic meaning except to indicate the last stable release.
For example, v0.704.0.1 is merely the first development release after v0.704.0.0. The next stable release could be a bug fix (v0.704.1.0), a feature enhancement (v0.705.0.0), or an API change (v1.0.0.0).
See the Changes file included with development releases for an indication of the nature of changes involved.
David Golden <david.golden@mongodb.org>
Mike Friedman <friedo@mongodb.com>
Kristina Chodorow <kristina@mongodb.org>
Florian Ragwitz <rafl@debian.org>
This software is Copyright (c) 2014 by MongoDB, Inc..
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.