Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-7391

Bad code is written on the mongo db's official website for the django integration, kindly fix this

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • No version
    • None
    • None
    • None
    • OS:
      node.js / npm versions:
      Additional info:
    • Not Needed

    Description

      Hello team!

      I was just going through your docs on how to integrate MongoDb with Django and on your website I just found a buggy code snippet.

      Here it is:

      from pymongo import MongoClient
      client = pymongo.MongoClient('connection_string')
      db = client['db_name']

      Here's the link of the code snippet: https://www.mongodb.com/compatibility/mongodb-and-django

      The correct one should be this:

      from pymongo import MongoClient
      client = MongoClient('connection_string')
      db = client['db_name']

      as we've already imported MongoClient from pymongo so there is no need to use it like pymongo.MongoClient.

      Thankyou

      Attachments

        Activity

          People

            Unassigned Unassigned
            code4anshu@gmail.com Anshuman Sharma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: