Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use "range_key_condition" to query a DynamoDB table with boto?
    text
    copied!<p>To get range_key between (0,9999), can I do it this way? </p> <pre><code>conn = boto.connect_dynamodb() table = conn.get_table("mytable") ... result = table.query( hash_key = "66", range_key_condition = {"0":"GE", "9999":"LE"} ) </code></pre> <h1>with boto v2.2.2-dev, I always get empty results</h1> <p>EDIT: This is a another error sample:</p> <pre><code>In [218]: qa = taa.query(hash_key = "1") In [219]: qa.next() Out[219]: {u'attra': u'this is attra', u'key': u'1', u'range': 1.1} </code></pre> <h2>It's OK without "range_key_condition" above</h2> <pre><code>In [220]: qa = taa.query(hash_key = "1", range_key_condition = {0.1: "GE"}) In [221]: qa.next() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /home/user/python/enva/&lt;ipython-input-221-dba0a498b6e1&gt; in &lt;module&gt;() ----&gt; 1 qa.next() /home/user/python/enva/local/lib/python2.7/site-packages/boto-2.2.2_dev-py2.7.egg/boto/dynamodb/layer2.pyc in query(self, table, hash_key, range_key_condition, attributes_to_get, request_limit, max_results, consistent_read, scan_index_forward, exclusive_start_key, item_class) 559 """ 560 if range_key_condition: --&gt; 561 rkc = self.dynamize_range_key_condition(range_key_condition) 562 else: 563 rkc = None /home/user/python/enva/local/lib/python2.7/site-packages/boto-2.2.2_dev-py2.7.egg/boto/dynamodb/layer2.pyc in dynamize_range_key_condition(self, range_key_condition) 83 structure required by Layer1. 84 """ ---&gt; 85 return range_key_condition.to_dict() 86 87 def dynamize_scan_filter(self, scan_filter): AttributeError: 'dict' object has no attribute 'to_dict' </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload