mongo查询返回结果显示
方式一:
for i in data:
result_index=i.keys()
result_value=i.values()
jsonkv.append(dict(zip(result_index,result_value)))
jsonreturn = json.dumps(jsonkv, cls=JsonEncoder)
print jsonreturn
方式二:
for i in data:
result.append(i)
print result