zoukankan      html  css  js  c++  java
  • pymongo的几个操作

    # -*- 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})
    
    
    
  • 相关阅读:
    053587
    053586
    053585
    053584
    053583
    053582
    053581
    053580
    053579
    053578
  • 原文地址:https://www.cnblogs.com/c-x-a/p/9707442.html
Copyright © 2011-2022 走看看