预期效果是运行程序后输入我已知的userid:100000最后查询出正确的结果目前报错说TypeError: 'int' object is not iterable但是我也不知道为啥会说int不能迭代,我只是要输入100000这个数字就给我返回查询结果啊。憋好久了,求指点!代码如下:#"coding:utf8"import pymongoconn = pymongo.Connection('localhost', 27017)#选择MyUser库db = conn.MyUser#使用UserFriend集合collection=db.UserFriendch = int(raw_input('Enter the userid : '))print collection.find_one("{'UserId':(%d)}",ch)
添加回答
举报
0/150
提交
取消