使用pymongo 遍历mongo表
1、使用pymongo操作mongodb简单示例
#!/usr/bin/env python # -*- coding:utf-8 -*- import pymongo mon_conn = pymongo.Connection(‘192.168.10.1‘, 27017) db = mon_conn.db_teams collectionlist = db.collection_names() for collection in collectionlist: print "%-10s" % collection,db[collection].find().count()
本文出自 “拥抱开源” 博客,请务必保留此出处http://junit.blog.51cto.com/9897514/1612538
文章来自:http://junit.blog.51cto.com/9897514/1612538