pymongo的几个操作

mac2022-06-30  22

# -*- coding: utf-8 -*- # @Time : 2018/9/11 17:16 # @Author : cxa # @File : mongotest.py # @Software: PyCharm import pymongo client = pymongo.MongoClient(host='172.17.0.170') db = client.库名 collection = db.表名 print(collection.find({'status':0}).count())#查找status字段值为0的 数据的条数 #collection.update_many({},{'$set':{'status':0,'last_crawl_time':0}}) #更新所有的状态 #c2.update_many({'status':3},{'$rename': {'type_url ': 'type_url'}}) #修改表名 # results = collection.find({'status': 1})

转载于:https://www.cnblogs.com/c-x-a/p/9707442.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)