Mongodb学习(10)一个小例子
跟mongodb相关的一个小例子
#!/sur/bin/python
#coding:utf-8
from bottle import get, run
import pymongo
@get('/')
def homepage_test():
return '<p style="color:red">Hello World!</p>'
@get('/')
def homepage():
db=pymongo.MongoClient().test
rst=""
for i in db.test.find():
rst += "<p>"+i['Text']+"</p>"
return rst
run(host='', port=25252)