首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

python 联接mongo数据库,进行简单的增删该查

2013-12-09 
python 连接mongo数据库,进行简单的增删该查实例:# -*- coding: cp936 -*-import pymongodictSearContion

python 连接mongo数据库,进行简单的增删该查
实例:
# -*- coding: cp936 -*-
import pymongo

dictSearContion = {'STATE_1':1, 'STATUS':1}

client = pymongo.MongoClient("192.168.0.103", 27017)
replyDB = client.REPLY
topicDB = client.TOPIC

def getExcelTopics(collectionName):
    topics = topicDB.TOPIC_COL.find(dictSearContion)
    for i in topics:
        print i



if __name__=='__main__':
    getExcelTopics("TOPIC_COLL")


热点排行