分类目录

链接

2020 年 11 月
 1
2345678
9101112131415
16171819202122
23242526272829
30  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > MongoDB > 正文
docker安装mongodb
MongoDB 暂无评论 阅读(218)

 

docker pull mongo

docker run -p 27017:27017 --privileged=true -v /server/mongodb/data:/data/db --name mongo -d mongo

 

MONGODB连接工具官方绿色版:

https://download.studio3t.com/robomongo/windows/robo3t-1.4.2-windows-x86_64-8650949.zip

 

self.myclient = pymongo.MongoClient("mongodb://xxxxxx:27017", username="admin",
                                    password="xxxx@123")  # Host以及port
self.db = self.myclient["xxxx"]

collection = self.db[item.source]

data = collection.find_one({'title': item.title, 'source': item.source})
if item is not None:
    collection.insert_one(item)
else:
    collection.update_one(item, {"$set", data})


============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:docker安装mongodb | Bruce's Blog

发表评论

留言无头像?