[COMPASS-7391] Bad code is written on the mongo db's official website for the django integration, kindly fix this Created: 02/Nov/23  Updated: 03/Nov/23  Resolved: 03/Nov/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Bug Priority: Major - P3
Reporter: Anshuman Sharma Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS:
node.js / npm versions:
Additional info:


Attachments: PNG File issue.PNG    
Documentation Changes: 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



 Comments   
Comment by Sergey Petushkov [ 03/Nov/23 ]

We updated the page, thanks for the report.

Comment by PM Bot [ 02/Nov/23 ]

Hello code4anshu@gmail.com, thank you for reaching out to us! The team will review your issue and get back to you soon as soon as possible.

Please review your issue to ensure you've included your environment details and have attached relevant logs (with any sensitive data redacted), so that we're best able to provide you a timely and thorough response. Thanks again!

Generated at Wed Feb 07 22:46:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.