摘要:
#coding:utf-8 __author__ = 'hdfs' import pymongo from pymongo import MongoClient client = MongoClient() client=MongoClient('10.0.0.9',27017) #连接mongodb数据库 client = MongoClient('mongodb://10.0.0.9:27... 阅读全文
摘要:
#聚合查询 from pymongo import MongoClient db = MongoClient('mongodb://10.0.0.9:27017/').aggregation_example #准备数据 result = db.things.insert_many([{"x": 1, "tags": ["dog", "cat"]}, ... 阅读全文