Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12826

Incorrect docs for connecting Perl driver to MongoDB Atlas

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: drivers
    • Labels:
      None
    • Environment:
      cloud.mongodb.com connect string and Documentation Perl driver
    • 1

      On the https://docs.mongodb.com/ecosystem/drivers/perl/ the section Connect to MongoDB Atlas has a subtle bug because in Perl double quote " and simple quote ' are different. With double quote, something like "@cluster0" becomes interpolated as an undefined variable.

      It should be:

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

      The same problem exists in https://cloud.mongodb.com/
      Cluster0 => button connect => open Connect to Cluster0
      => connect your application
      => Choose your driver version => Perl => all version
      The 'Full driver example' has a mistake

      my $client = MongoDB->connect("mongodb+srv://dev-admin:<password>@cluster0-xxxxx.azure.mongodb.net/test?retryWrites=true&w=majority");
      

      Should be written:

      my $client = MongoDB->connect('mongodb+srv://dev-admin:<password>@cluster0-xxxxx.azure.mongodb.net/test?retryWrites=true&w=majority');
      

            Assignee:
            chris.bush@mongodb.com Chris Bush
            Reporter:
            ftls Frederic T.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              4 years, 46 weeks ago