【发布时间】:2016-08-28 02:23:05
【问题描述】:
我用 python 3、mongodb 和 bottle 编写代码。
此代码返回空文档。我检查了name,这是正确的值。
@bottle.route('/test1/<name>', method='GET')
def test_detail(name):
result = dbcoll.find({"student": name})
return template('detail',name=result)
我修改为硬编码name,它可以正确显示结果!
@bottle.route('/test1/<name>', method='GET')
def test_detail(name):
name = "peter chan"
result = dbcoll.find({"student": name})
return template('detail',name=result)
【问题讨论】: