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
相關文章
相關標籤/搜索