1
我試圖在使用MongoDB和Pymongo的pycharm中創建項目。 但我遇到了以下錯誤:URI模式無效Python,MongoDB錯誤
Traceback (most recent call last):
File "C:/Users/IngeniousAmbivert/PycharmProjects/terminal_blog/app.py", line 6, in <module>
client = pymongo.MongoClient(uri)
File "C:\Users\IngeniousAmbivert\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pymongo\mongo_client.py", line 400, in __init__"%s" % (entity[:idx],))
pymongo.errors.InvalidURI: Invalid URI scheme: mongodb
對於下面的代碼:
import pymongo
uri = " mongodb://127.0.0.1:27017"
client = pymongo.MongoClient(uri)
database = client['stack']
collection = database['students']
students = collection.find({})
print(students)
任何幫助將不勝感激。