MongoDB使用
#coding:utf-8 #! /usr/bin/python ''' Author fiz Date:2016-03-30 ''' import pymongo client = pymongo.MongoClient() db = client.test_db collection = db.test_collection mydict = {'name':'Lucy', 'sex':'female','job':'nurse'} mylist = [] mylist.append(mydict) collection.insert_many(mylist) for i in collection.find({'name':'Lucy'}): print i