1

The following query returns all the records instead of just 2. When I run the query in the AWS SimpleDB browser it works, however. Am I using boto wrong?

conn = boto.connect_sdb()
dom = conn.get_domain('taxplan')
query = 'select Descr, PlanName, ItemName, Plan, ReceivedTime from taxplan limit 2'
rs = dom.select(query)
sl= []
for j in rs:
    sl.append(j)
result['sboto'] = convert(sl[1:])

sys.stdout.write(json.dumps(result,indent=1))
mcktimo
  • 1,440
  • 4
  • 19
  • 35

1 Answers1

4

It seems the problem is the:

for j in rs:

It seems that the query is being run multiple times, because of the iteration, not sure exactly. I fixed the problem for me by replacing:

rs = dom.select(query)

with

rs = dom.select(query,max_items=2)

Hope that helps.

skier31415
  • 121
  • 5