{
    "mode": "perldoc",
    "parameter": "MongoDB",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/MongoDB/json",
    "generated": "2026-10-06T07:04:47Z",
    "synopsis": "use MongoDB;\nmy $client     = MongoDB->connect('mongodb://localhost');\nmy $collection = $client->ns('foo.bar'); # database foo, collection bar\nmy $result     = $collection->insertone({ some => 'data' });\nmy $data       = $collection->findone({ id => $result->insertedid });",
    "sections": {
        "NAME": {
            "content": "MongoDB - Official MongoDB Driver for Perl (EOL)\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version v2.2.2\n",
            "subsections": []
        },
        "END OF LIFE NOTICE": {
            "content": "Version v2.2.0 was the final feature release of the MongoDB Perl driver and version v2.2.2 is\nthe final patch release.\n\nAs of August 13, 2020, the MongoDB Perl driver and related libraries have reached end of life\nand are no longer supported by MongoDB. See the August 2019 deprecation notice\n<https://www.mongodb.com/blog/post/the-mongodb-perl-driver-is-being-deprecated> for rationale.\n\nIf members of the community wish to continue development, they are welcome to fork the code\nunder the terms of the Apache 2 license and release it under a new namespace. Specifications and\ntest files for MongoDB drivers and libraries are published in an open repository:\nmongodb/specifications <https://github.com/mongodb/specifications/tree/master/source>.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use MongoDB;\n\nmy $client     = MongoDB->connect('mongodb://localhost');\nmy $collection = $client->ns('foo.bar'); # database foo, collection bar\nmy $result     = $collection->insertone({ some => 'data' });\nmy $data       = $collection->findone({ id => $result->insertedid });\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is the official Perl driver for MongoDB <http://www.mongodb.com>. MongoDB is an open-source\ndocument database that provides high performance, high availability, and easy scalability.\n\nA MongoDB server (or multi-server deployment) hosts a number of databases. A database holds a\nset of collections. A collection holds a set of documents. A document is a set of key-value\npairs. Documents have dynamic schema. Using dynamic schema means that documents in the same\ncollection do not need to have the same set of fields or structure, and common fields in a\ncollection's documents may hold different types of data.\n\nHere are some resources for learning more about MongoDB:\n\n*   MongoDB Manual <http://docs.mongodb.org/manual/contents/>\n\n*   MongoDB CRUD Introduction <http://docs.mongodb.org/manual/core/crud-introduction/>\n\n*   MongoDB Data Modeling Introductions\n<http://docs.mongodb.org/manual/core/data-modeling-introduction/>\n\nTo get started with the Perl driver, see these pages:\n\n*   MongoDB Perl Driver Tutorial\n\n*   MongoDB Perl Driver Examples\n\nExtensive documentation and support resources are available via the MongoDB community website\n<http://www.mongodb.org/>.\n",
            "subsections": []
        },
        "USAGE": {
            "content": "The MongoDB driver is organized into a set of classes representing different levels of\nabstraction and functionality.\n\nAs a user, you first create and configure a MongoDB::MongoClient object to connect to a MongoDB\ndeployment. From that client object, you can get a MongoDB::Database object for interacting with\na specific database.\n\nFrom a database object, you can get a MongoDB::Collection object for CRUD operations on that\nspecific collection, or a MongoDB::GridFSBucket object for working with an abstract file system\nhosted on the database. Each of those classes may return other objects for specific features or\nfunctions.\n\nSee the documentation of those classes for more details or the MongoDB Perl Driver Tutorial for\nan example.\n\nMongoDB::ClientSession objects are generated from a MongoDB::MongoClient and allow for advanced\nconsistency options, like causal-consistency and transactions.\n",
            "subsections": [
                {
                    "name": "Error handling",
                    "content": "Unless otherwise documented, errors result in fatal exceptions. See MongoDB::Error for a list of\nexception classes and error code constants.\n"
                }
            ]
        },
        "METHODS": {
            "content": "connect\n$client = MongoDB->connect(); # localhost, port 27107\n$client = MongoDB->connect($hosturi);\n$client = MongoDB->connect($hosturi, $options);\n\nThis function returns a MongoDB::MongoClient object. The first parameter is used as the \"host\"\nargument and must be a host name or connection string URI. The second argument is optional. If\nprovided, it must be a hash reference of constructor arguments for MongoDB::MongoClient::new.\n\nIf an error occurs, a MongoDB::Error object will be thrown.\n\nNOTE: To connect to a replica set, a replica set name must be provided. For example, if the set\nname is \"setA\":\n\n$client = MongoDB->connect(\"mongodb://example.com/?replicaSet=setA\");\n",
            "subsections": []
        },
        "SUPPORTED MONGODB VERSIONS": {
            "content": "The driver has been tested against MongoDB versions 2.6 through 4.2. All features of these\nversions are supported, except for field-level encryption. The driver may work with future\nversions of MongoDB, but will not include support for new MongoDB features and should be\nthoroughly tested within applications before deployment.\n",
            "subsections": []
        },
        "SEMANTIC VERSIONING SCHEME": {
            "content": "Starting with MongoDB \"v1.0.0\", the driver reverts to the more familiar three-part version-tuple\nnumbering scheme used by both Perl and MongoDB: \"vX.Y.Z\"\n\n*   \"X\" will be incremented for incompatible API changes.\n\n*   Even-value increments of \"Y\" indicate stable releases with new functionality. \"Z\" will be\nincremented for bug fixes.\n\n*   Odd-value increments of \"Y\" indicate unstable (\"development\") releases that should not be\nused in production. \"Z\" increments have no semantic meaning; they indicate only successive\ndevelopment releases.\n\nSee the Changes file included with releases for an indication of the nature of changes involved.\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "If the \"PERLMONGOWITHASSERTS\" environment variable is true before the MongoDB module is\nloaded, then its various classes will be generated with internal type assertions enabled. This\nhas a severe performance cost and is not recommended for production use. It may be useful in\ndiagnosing bugs.\n\nIf the \"PERLMONGONODEPWARNINGS\" environment variable is true, then deprecated methods will\nnot issue warnings when used. (Normally, a deprecation warning is issued once per call-site for\ndeprecated methods.)\n",
            "subsections": []
        },
        "THREADS": {
            "content": "Per threads documentation, use of Perl threads is discouraged by the maintainers of Perl and the\nMongoDB Perl driver does not test or provide support for use with threads.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   David Golden <david@mongodb.com>\n\n*   Rassi <rassi@mongodb.com>\n\n*   Mike Friedman <friedo@friedo.com>\n\n*   Kristina Chodorow <k.chodorow@gmail.com>\n\n*   Florian Ragwitz <rafl@debian.org>\n",
            "subsections": []
        },
        "CONTRIBUTORS": {
            "content": "*   Andrew Page <andrew@infosiftr.com>\n\n*   Andrey Khozov <avkhozov@gmail.com>\n\n*   Ashley Willis <ashleyw@cpan.org>\n\n*   Ask Bjørn Hansen <ask@develooper.com>\n\n*   Bernard Gorman <bernard.gorman@mongodb.com>\n\n*   Brendan W. McAdams <brendan@mongodb.com>\n\n*   Brian Moss <kallimachos@gmail.com>\n\n*   Casey Rojas <casey.j.rojas@gmail.com>\n\n*   Christian Hansen <chansen@cpan.org>\n\n*   Christian Sturm <kind@gmx.at>\n\n*   Christian Walde <walde.christian@googlemail.com>\n\n*   Colin Cyr <ccyr@sailingyyc.com>\n\n*   Danny Raetzsch <danny@paperskymedia.com>\n\n*   David Morrison <dmorrison@venda.com>\n\n*   David Nadle <david@nadle.com>\n\n*   David Steinbrunner <dsteinbrunner@pobox.com>\n\n*   David Storch <david.storch@mongodb.com>\n\n*   diegok <diego@freekeylabs.com>\n\n*   D. Ilmari Mannsåker <ilmari.mannsaker@net-a-porter.com>\n\n*   Eric Daniels <eric.daniels@mongodb.com>\n\n*   Finn Kempers (Shadowcat Systems Ltd) <toyou1995@gmail.com>\n\n*   Gerard Goossen <gerard@ggoossen.net>\n\n*   Glenn Fowler <cebjyre@cpan.org>\n\n*   Graham Barr <gbarr@pobox.com>\n\n*   Hao Wu <echowuhao@gmail.com>\n\n*   Harish Upadhyayula <hupadhyayula@dealersocket.com>\n\n*   Jason Carey <jason.carey@mongodb.com>\n\n*   Jason Toffaletti <jason@topsy.com>\n\n*   Johann Rolschewski <rolschewski@gmail.com>\n\n*   John A. Kunze <jak@ucop.edu>\n\n*   Joseph Harnish <bigjoe1008@gmail.com>\n\n*   Josh Matthews <joshua.matthews@mongodb.com>\n\n*   Joshua Juran <jjuran@metamage.com>\n\n*   J. Stewart <jstewart@langley.theshire>\n\n*   Kamil Slowikowski <kslowikowski@gmail.com>\n\n*   Ken Williams <kwilliams@cpan.org>\n\n*   Matthew Shopsin <matt.shopsin@mongodb.com>\n\n*   Matt S Trout <mst@shadowcat.co.uk>\n\n*   Michael Langner <langner@fch.de>\n\n*   Michael Rotmanov <rotmanov@sipgate.de>\n\n*   Mike Dirolf <mike@mongodb.com>\n\n*   Mohammad S Anwar <mohammad.anwar@yahoo.com>\n\n*   Nickola Trupcheff <n.trupcheff@gmail.com>\n\n*   Nigel Gregoire <nigelg@airg.com>\n\n*   Niko Tyni <ntyni@debian.org>\n\n*   Nuno Carvalho <mestre.smash@gmail.com>\n\n*   Orlando Vazquez <ovazquez@gmail.com>\n\n*   Othello Maurer <omaurer@venda.com>\n\n*   Pan Fan <nightsailer@gmail.com>\n\n*   Pavel Denisov <pavel.a.denisov@gmail.com>\n\n*   Rahul Dhodapkar <rahul@mongodb.com>\n\n*   Robert Sedlacek (Shadowcat Systems Ltd) <phaylon@cpan.org>\n\n*   Robin Lee <cheeselee@fedoraproject.org>\n\n*   Roman Yerin <kid@cpan.org>\n\n*   Ronald J Kimball <rkimball@pangeamedia.com>\n\n*   Ryan Chipman <ryan@ryanchipman.com>\n\n*   Slaven Rezic <slaven.rezic@idealo.de>\n\n*   Slaven Rezic <srezic@cpan.org>\n\n*   Stephen Oberholtzer <stevie@qrpff.net>\n\n*   Steve Sanbeg <stevesanbeg@buzzfeed.com>\n\n*   Stuart Watt <stuart@morungos.com>\n\n*   Thomas Bloor (Shadowcat Systems Ltd) <tbsliver@cpan.org>\n\n*   Tobias Leich <email@froggs.de>\n\n*   Uwe Voelker <uwe.voelker@xing.com>\n\n*   Wallace Reis <wallace@reis.me>\n\n*   Wan Bachtiar <sindbach@gmail.com>\n\n*   Whitney Jackson <whjackson@gmail.com>\n\n*   Xavier Guimard <x.guimard@free.fr>\n\n*   Xtreak <tirkarthi@users.noreply.github.com>\n\n*   Zhihong Zhang <zzh621@yahoo.com>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is Copyright (c) 2020 by MongoDB, Inc.\n\nThis is free software, licensed under:\n\nThe Apache License, Version 2.0, January 2004\n",
            "subsections": []
        }
    },
    "summary": "MongoDB - Official MongoDB Driver for Perl (EOL)",
    "flags": [],
    "examples": [],
    "see_also": []
}