首页 > 技术文章 > MongoDB ODM

goddog1024 2019-07-23 14:48 原文

安装

 pip3 install mongoengine

 

连接MongoDB

 方法一:简写

 connect('students)

 方法二:指定端口和地址

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

 方法三:使用URI

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

 

  python连接

 

 

推荐阅读