pymongo简单用法

  1. 安装 pip install pymongo
  2. 查询
from pymongo import MongoClient

    mongoClient = MongoClient('localhost',27017)  #准备一个client
    db= mongoClient['helloworld']                 #选择db
    collection = db['test']                       #选择collection
    
    total = collection.find().count()             #total
相关文章
相关标签/搜索