• <bdo id='Wm79f'></bdo><ul id='Wm79f'></ul>
    <tfoot id='Wm79f'></tfoot>

  • <legend id='Wm79f'><style id='Wm79f'><dir id='Wm79f'><q id='Wm79f'></q></dir></style></legend>
  • <i id='Wm79f'><tr id='Wm79f'><dt id='Wm79f'><q id='Wm79f'><span id='Wm79f'><b id='Wm79f'><form id='Wm79f'><ins id='Wm79f'></ins><ul id='Wm79f'></ul><sub id='Wm79f'></sub></form><legend id='Wm79f'></legend><bdo id='Wm79f'><pre id='Wm79f'><center id='Wm79f'></center></pre></bdo></b><th id='Wm79f'></th></span></q></dt></tr></i><div id='Wm79f'><tfoot id='Wm79f'></tfoot><dl id='Wm79f'><fieldset id='Wm79f'></fieldset></dl></div>

      <small id='Wm79f'></small><noframes id='Wm79f'>

        使用查询从 DynamoDB 中检索所有项目?

        Retrieve all items from DynamoDB using query?(使用查询从 DynamoDB 中检索所有项目?)
        <legend id='6NKGE'><style id='6NKGE'><dir id='6NKGE'><q id='6NKGE'></q></dir></style></legend>

          <tfoot id='6NKGE'></tfoot>

          • <small id='6NKGE'></small><noframes id='6NKGE'>

            <i id='6NKGE'><tr id='6NKGE'><dt id='6NKGE'><q id='6NKGE'><span id='6NKGE'><b id='6NKGE'><form id='6NKGE'><ins id='6NKGE'></ins><ul id='6NKGE'></ul><sub id='6NKGE'></sub></form><legend id='6NKGE'></legend><bdo id='6NKGE'><pre id='6NKGE'><center id='6NKGE'></center></pre></bdo></b><th id='6NKGE'></th></span></q></dt></tr></i><div id='6NKGE'><tfoot id='6NKGE'></tfoot><dl id='6NKGE'><fieldset id='6NKGE'></fieldset></dl></div>

              <tbody id='6NKGE'></tbody>
              <bdo id='6NKGE'></bdo><ul id='6NKGE'></ul>

                1. 本文介绍了使用查询从 DynamoDB 中检索所有项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用查询检索 dynamodb 表中的所有项目.以下是我的代码:

                  I am trying to retrieve all items in a dynamodb table using a query. Below is my code:

                  import boto.dynamodb2
                  from boto.dynamodb2.table import Table
                  from time import sleep
                  
                  c    = boto.dynamodb2.connect_to_region(aws_access_key_id="XXX",aws_secret_access_key="XXX",region_name="us-west-2")
                  
                  tab  = Table("rip.irc",connection=c)
                  
                  x    = tab.query()
                  
                  for i in x:
                      print i
                      sleep(1)
                  

                  但是,我收到以下错误:

                  However, I recieve the following error:

                  ValidationException: ValidationException: 400 Bad Request
                  {'message': 'Conditions can be of length 1 or 2 only', '__type': 'com.amazon.coral.validate#ValidationException'}
                  

                  我的代码非常简单,不属于 boto dynamodb2 文档,所以我不确定为什么会出现上述错误.任何见解都将不胜感激(对此是新的,有点迷失).谢谢

                  The code I have is pretty straightforward and out of the boto dynamodb2 docs, so I am not sure why I am getting the above error. Any insights would be appreciated (new to this and a bit lost). Thanks

                  我有一个哈希键和一个范围键.我可以通过特定的哈希键进行查询.例如,

                  I have both an hash key and a range key. I am able to query by specific hash keys. For example,

                  x = tab.query(hash__eq="2014-01-20 05:06:29")
                  

                  我怎样才能检索所有项目?

                  How can I retrieve all items though?

                  推荐答案

                  啊,好吧,想通了.如果有人需要:

                  Ahh ok, figured it out. If anyone needs:

                  您不能在不指定特定哈希键的情况下对表使用查询方法.代替使用的方法是扫描.所以如果我替换:

                  You can't use the query method on a table without specifying a specific hash key. The method to use instead is scan. So if I replace:

                  x    = tab.query()
                  

                  x    = tab.scan()
                  

                  我得到了我桌子上的所有物品.

                  I get all the items in my table.

                  这篇关于使用查询从 DynamoDB 中检索所有项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  env: python: No such file or directory(env: python: 没有这样的文件或目录)
                  How to evaluate environment variables into a string in Python?(如何在 Python 中将环境变量评估为字符串?)
                  Python - temporarily modify the current process#39;s environment(Python - 临时修改当前进程的环境)
                  Change current process environment#39;s LD_LIBRARY_PATH(更改当前进程环境的 LD_LIBRARY_PATH)
                  Reading and writing environment variables in Python?(在 Python 中读写环境变量?)
                  When to use sys.path.append and when modifying %PYTHONPATH% is enough(何时使用 sys.path.append 以及何时修改 %PYTHONPATH% 就足够了)
                  <tfoot id='BRlnX'></tfoot>

                  • <bdo id='BRlnX'></bdo><ul id='BRlnX'></ul>

                    1. <i id='BRlnX'><tr id='BRlnX'><dt id='BRlnX'><q id='BRlnX'><span id='BRlnX'><b id='BRlnX'><form id='BRlnX'><ins id='BRlnX'></ins><ul id='BRlnX'></ul><sub id='BRlnX'></sub></form><legend id='BRlnX'></legend><bdo id='BRlnX'><pre id='BRlnX'><center id='BRlnX'></center></pre></bdo></b><th id='BRlnX'></th></span></q></dt></tr></i><div id='BRlnX'><tfoot id='BRlnX'></tfoot><dl id='BRlnX'><fieldset id='BRlnX'></fieldset></dl></div>
                        <legend id='BRlnX'><style id='BRlnX'><dir id='BRlnX'><q id='BRlnX'></q></dir></style></legend>

                          <tbody id='BRlnX'></tbody>

                        <small id='BRlnX'></small><noframes id='BRlnX'>