MongoDB ODM

安装

 pip3 install mongoengine

 

连接MongoDB

 方法一:简写

 connect('students)

 方法二:指定端口和地址

 connect('students',host='192.168.1.35',port=27017)

 方法三:使用URI

 connect('students',host='mongodb://localhost/students')

 

  python连接

 

 

posted @ 2019-07-23 14:48  goddog1024  阅读(234)  评论(0编辑  收藏  举报