Navigation

MongoDB Perl Driver

Introduction

This is the official MongoDB Perl Driver.

Installation

The Perl Driver is available through CPAN as the package MongoDB.

You can install the latest stable release by installing the MongoDB package:

$ cpan MongoDB

See Installation for more information.

Connect to MongoDB Atlas

To connect to a MongoDB Atlas cluster, use the Atlas connection string for your cluster:

use MongoDB;

my $client = MongoDB->connect(
  'mongodb+srv://<username>:<password>@<cluster-address>/test?retryWrites=true&w=majority'
);
my $db = $client->get_database( 'test' );

See Connecting for more information.

Compatibility

MongoDB Compatibility

The following compatibility table specifies the recommended version(s) of the MongoDB Perl driver for use with a specific version of MongoDB.

The first column lists the driver version(s).

Perl Driver MongoDB 4.0 MongoDB 3.6 MongoDB 3.4 MongoDB 3.2 MongoDB 3.0 MongoDB 2.6
2.0.x
1.8.x    
1.6.x    
1.4.x      
1.2.x      
1.0.x        

The driver does not support older versions of MongoDB.

Language Compatibility

The MongoDB Perl driver requires Perl 5.10.1 or later.

How to get help