各位, 我正在尝试使以下代码工作以返回表中的行计数:
import boto
import boto.dynamodb2
from boto.dynamodb2.table import Table
from boto.dynamodb2.fields import HashKey, RangeKey
drivers = Table('current_fhv_drivers')
rowcountquery = drivers.query(
number = 'blah',
expiration = 'foo',
count=True,
)
for x in rowcountquery:
print x['Count']
我看到的错误是:
^{pr2}$获取行计数的正确语法是什么:)
谢谢!在
该异常基本上是告诉您,boto无法识别运算符“count”。在
如果你读了关于http://boto.readthedocs.org/en/latest/dynamodb2_tut.html#querying的第二段,你会看到:
所以我把你的代码改成:
相关问题 更多 >
编程相关推荐