.. _perl-language-center:

.. include:: /includes/unicode-checkmark.rst

===================
MongoDB Perl Driver
===================

.. default-domain:: mongodb

.. contents:: On this page
   :local:
   :backlinks: none
   :depth: 1
   :class: twocols

.. admonition:: Deprecation
   :class: warning

   Version v2.2.0 is the final feature release of the MongoDB Perl driver.
   The driver is now in a 12-month "sunset" period and will receive
   security patches and critical bug fixes only.
   The Perl driver will be end-of-life and unsupported on August 13, 2020.

   For more information,
   read `here <https://www.mongodb.com/blog/post/the-mongodb-perl-driver-is-being-deprecated>`_.



Introduction
------------

This is the official MongoDB Perl Driver.

- `Source Code <https://github.com/mongodb/mongo-perl-driver>`__


Installation
------------

The Perl Driver is available through CPAN as the package
`MongoDB <https://metacpan.org/pod/MongoDB>`_.

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

.. code-block:: sh

   $ cpan MongoDB

See `Installation <https://github.com/mongodb/mongo-perl-driver/blob/master/INSTALL.md>`_
for more information.


Connect to MongoDB Atlas
------------------------

.. include:: /includes/atlas-connect-blurb.rst

.. code-block:: perl

   use MongoDB;

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


Compatibility
-------------

MongoDB Compatibility
~~~~~~~~~~~~~~~~~~~~~

.. include:: /includes/mongodb-compatibility-table-perl.rst

Language Compatibility
~~~~~~~~~~~~~~~~~~~~~~

.. include:: /includes/language-compatibility-table-perl.rst

.. include:: /includes/help-links-general.rst
