python操做mongodb實例

安裝pymongo擴展python

import pymongo;
client = pymongo.MongoClient(host='10.48.176.170',port=27017);
db = client.test;
print db.test_lhy.find_one();

  

import pymongo;

client = pymongo.Connection(host='10.48.176.170', port=27017);
db = client.test;
print db.test_lhy.find_one();
相關文章
相關標籤/搜索