€cdocutils.nodes document q)q}q(U nametypesq}q(Xusing an existing tableqNXqueryingqNXcreating new tablesqNXdeleting an itemq NXdeleting a tableq NXdynamodbq ˆXgetting an existing itemq NXcreating an itemq NX)migrating from dynamodb v1 to dynamodb v2qNXupdating throughputqNX batch writesqNXupdating an itemqNX batch getsqNXscansqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hUusing-an-existing-tableqhUqueryingqhUcreating-new-tablesqh Udeleting-an-itemq h Udeleting-a-tableq!h Udynamodbq"h Ugetting-an-existing-itemq#h Ucreating-an-itemq$hU)migrating-from-dynamodb-v1-to-dynamodb-v2q%hUupdating-throughputq&hU batch-writesq'hUupdating-an-itemq(hU batch-getsq)hUscansq*uUchildrenq+]q,(cdocutils.nodes comment q-)q.}q/(U rawsourceq0Xdynamodb_v1_to_v2:Uparentq1hUsourceq2XR/Users/kyleknap/Documents/GitHub/boto/docs/source/migrations/dynamodb_v1_to_v2.rstq3Utagnameq4Ucommentq5U attributesq6}q7(U xml:spaceq8Upreserveq9Uidsq:]Ubackrefsq;]Udupnamesq<]Uclassesq=]Unamesq>]uUlineq?KUdocumentq@hh+]qAcdocutils.nodes Text qBXdynamodb_v1_to_v2:qC…qD}qE(h0Uh1h.ubaubcdocutils.nodes section qF)qG}qH(h0Uh1hh2h3h4UsectionqIh6}qJ(h<]h=]h;]h:]qKh%ah>]qLhauh?Kh@hh+]qM(cdocutils.nodes title qN)qO}qP(h0X)Migrating from DynamoDB v1 to DynamoDB v2qQh1hGh2h3h4UtitleqRh6}qS(h<]h=]h;]h:]h>]uh?Kh@hh+]qThBX)Migrating from DynamoDB v1 to DynamoDB v2qU…qV}qW(h0hQh1hOubaubcdocutils.nodes paragraph qX)qY}qZ(h0XFor the v2 release of AWS' DynamoDB_, the high-level API for interacting via ``boto`` was rewritten. Since there were several new features added in v2, people using the v1 API may wish to transition their code to the new API. This guide covers the high-level APIs.h1hGh2h3h4U paragraphq[h6}q\(h<]h=]h;]h:]h>]uh?Kh@hh+]q](hBXFor the v2 release of AWS' q^…q_}q`(h0XFor the v2 release of AWS' h1hYubcdocutils.nodes reference qa)qb}qc(h0X DynamoDB_UresolvedqdKh1hYh4U referenceqeh6}qf(UnameXDynamoDBUrefuriqgXhttp://aws.amazon.com/dynamodb/qhh:]h;]h<]h=]h>]uh+]qihBXDynamoDBqj…qk}ql(h0Uh1hbubaubhBX), the high-level API for interacting via qm…qn}qo(h0X), the high-level API for interacting via h1hYubcdocutils.nodes literal qp)qq}qr(h0X``boto``h6}qs(h<]h=]h;]h:]h>]uh1hYh+]qthBXbotoqu…qv}qw(h0Uh1hqubah4UliteralqxubhBX³ was rewritten. Since there were several new features added in v2, people using the v1 API may wish to transition their code to the new API. This guide covers the high-level APIs.qy…qz}q{(h0X³ was rewritten. Since there were several new features added in v2, people using the v1 API may wish to transition their code to the new API. This guide covers the high-level APIs.h1hYubeubcdocutils.nodes target q|)q}}q~(h0X-.. _DynamoDB: http://aws.amazon.com/dynamodb/U referencedqKh1hGh2h3h4Utargetq€h6}q(hghhh:]q‚h"ah;]h<]h=]h>]qƒh auh?K h@hh+]ubhF)q„}q…(h0Uh1hGh2h3h4hIh6}q†(h<]h=]h;]h:]q‡hah>]qˆhauh?Kh@hh+]q‰(hN)qŠ}q‹(h0XCreating New TablesqŒh1h„h2h3h4hRh6}q(h<]h=]h;]h:]h>]uh?Kh@hh+]qŽhBXCreating New Tablesq…q}q‘(h0hŒh1hŠubaubhX)q’}q“(h0X DynamoDB v1::q”h1h„h2h3h4h[h6}q•(h<]h=]h;]h:]h>]uh?Kh@hh+]q–hBX DynamoDB v1:q—…q˜}q™(h0X DynamoDB v1:h1h’ubaubcdocutils.nodes literal_block qš)q›}qœ(h0X•>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> message_table_schema = conn.create_schema( ... hash_key_name='forum_name', ... hash_key_proto_value=str, ... range_key_name='subject', ... range_key_proto_value=str ... ) >>> table = conn.create_table( ... name='messages', ... schema=message_table_schema, ... read_units=10, ... write_units=10 ... )h1h„h2h3h4U literal_blockqh6}qž(h8h9h:]h;]h<]h=]h>]uh?Kh@hh+]qŸhBX•>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> message_table_schema = conn.create_schema( ... hash_key_name='forum_name', ... hash_key_proto_value=str, ... range_key_name='subject', ... range_key_proto_value=str ... ) >>> table = conn.create_table( ... name='messages', ... schema=message_table_schema, ... read_units=10, ... write_units=10 ... )q …q¡}q¢(h0Uh1h›ubaubhX)q£}q¤(h0X DynamoDB v2::q¥h1h„h2h3h4h[h6}q¦(h<]h=]h;]h:]h>]uh?K#h@hh+]q§hBX DynamoDB v2:q¨…q©}qª(h0X DynamoDB v2:h1h£ubaubhš)q«}q¬(h0X6>>> from boto.dynamodb2.fields import HashKey >>> from boto.dynamodb2.fields import RangeKey >>> from boto.dynamodb2.table import Table >>> table = Table.create('messages', schema=[ ... HashKey('forum_name'), ... RangeKey('subject'), ... ], throughput={ ... 'read': 10, ... 'write': 10, ... })h1h„h2h3h4hh6}q­(h8h9h:]h;]h<]h=]h>]uh?K%h@hh+]q®hBX6>>> from boto.dynamodb2.fields import HashKey >>> from boto.dynamodb2.fields import RangeKey >>> from boto.dynamodb2.table import Table >>> table = Table.create('messages', schema=[ ... HashKey('forum_name'), ... RangeKey('subject'), ... ], throughput={ ... 'read': 10, ... 'write': 10, ... })q¯…q°}q±(h0Uh1h«ubaubeubhF)q²}q³(h0Uh1hGh2h3h4hIh6}q´(h<]h=]h;]h:]qµhah>]q¶hauh?K3h@hh+]q·(hN)q¸}q¹(h0XUsing an Existing Tableqºh1h²h2h3h4hRh6}q»(h<]h=]h;]h:]h>]uh?K3h@hh+]q¼hBXUsing an Existing Tableq½…q¾}q¿(h0hºh1h¸ubaubhX)qÀ}qÁ(h0X DynamoDB v1::qÂh1h²h2h3h4h[h6}qÃ(h<]h=]h;]h:]h>]uh?K5h@hh+]qÄhBX DynamoDB v1:qÅ…qÆ}qÇ(h0X DynamoDB v1:h1hÀubaubhš)qÈ}qÉ(h0Xµ>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() # With API calls. >>> table = conn.get_table('messages') # Without API calls. >>> message_table_schema = conn.create_schema( ... hash_key_name='forum_name', ... hash_key_proto_value=str, ... range_key_name='subject', ... range_key_proto_value=str ... ) >>> table = conn.table_from_schema( ... name='messages', ... schema=message_table_schema)h1h²h2h3h4hh6}qÊ(h8h9h:]h;]h<]h=]h>]uh?K7h@hh+]qËhBXµ>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() # With API calls. >>> table = conn.get_table('messages') # Without API calls. >>> message_table_schema = conn.create_schema( ... hash_key_name='forum_name', ... hash_key_proto_value=str, ... range_key_name='subject', ... range_key_proto_value=str ... ) >>> table = conn.table_from_schema( ... name='messages', ... schema=message_table_schema)qÌ…qÍ}qÎ(h0Uh1hÈubaubhX)qÏ}qÐ(h0X DynamoDB v2::qÑh1h²h2h3h4h[h6}qÒ(h<]h=]h;]h:]h>]uh?KHh@hh+]qÓhBX DynamoDB v2:qÔ…qÕ}qÖ(h0X DynamoDB v2:h1hÏubaubhš)q×}qØ(h0X2>>> from boto.dynamodb2.table import Table # With API calls. >>> table = Table('messages') # Without API calls. >>> from boto.dynamodb2.fields import HashKey >>> from boto.dynamodb2.table import Table >>> table = Table('messages', schema=[ ... HashKey('forum_name'), ... HashKey('subject'), ... ])h1h²h2h3h4hh6}qÙ(h8h9h:]h;]h<]h=]h>]uh?KJh@hh+]qÚhBX2>>> from boto.dynamodb2.table import Table # With API calls. >>> table = Table('messages') # Without API calls. >>> from boto.dynamodb2.fields import HashKey >>> from boto.dynamodb2.table import Table >>> table = Table('messages', schema=[ ... HashKey('forum_name'), ... HashKey('subject'), ... ])qÛ…qÜ}qÝ(h0Uh1h×ubaubeubhF)qÞ}qß(h0Uh1hGh2h3h4hIh6}qà(h<]h=]h;]h:]qáh&ah>]qâhauh?KXh@hh+]qã(hN)qä}qå(h0XUpdating Throughputqæh1hÞh2h3h4hRh6}qç(h<]h=]h;]h:]h>]uh?KXh@hh+]qèhBXUpdating Throughputqé…qê}që(h0hæh1häubaubhX)qì}qí(h0X DynamoDB v1::qîh1hÞh2h3h4h[h6}qï(h<]h=]h;]h:]h>]uh?KZh@hh+]qðhBX DynamoDB v1:qñ…qò}qó(h0X DynamoDB v1:h1hìubaubhš)qô}qõ(h0X¬>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> conn.update_throughput(table, read_units=5, write_units=15)h1hÞh2h3h4hh6}qö(h8h9h:]h;]h<]h=]h>]uh?K\h@hh+]q÷hBX¬>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> conn.update_throughput(table, read_units=5, write_units=15)qø…qù}qú(h0Uh1hôubaubhX)qû}qü(h0X DynamoDB v2::qýh1hÞh2h3h4h[h6}qþ(h<]h=]h;]h:]h>]uh?Kah@hh+]qÿhBX DynamoDB v2:r…r}r(h0X DynamoDB v2:h1hûubaubhš)r}r(h0X•>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> table.update(throughput={ ... 'read': 5, ... 'write': 15, ... })h1hÞh2h3h4hh6}r(h8h9h:]h;]h<]h=]h>]uh?Kch@hh+]rhBX•>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> table.update(throughput={ ... 'read': 5, ... 'write': 15, ... })r…r}r (h0Uh1jubaubeubhF)r }r (h0Uh1hGh2h3h4hIh6}r (h<]h=]h;]h:]r h!ah>]rh auh?Klh@hh+]r(hN)r}r(h0XDeleting a Tablerh1j h2h3h4hRh6}r(h<]h=]h;]h:]h>]uh?Klh@hh+]rhBXDeleting a Tabler…r}r(h0jh1jubaubhX)r}r(h0X DynamoDB v1::rh1j h2h3h4h[h6}r(h<]h=]h;]h:]h>]uh?Knh@hh+]rhBX DynamoDB v1:r…r}r(h0X DynamoDB v1:h1jubaubhš)r }r!(h0X‰>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> conn.delete_table(table)h1j h2h3h4hh6}r"(h8h9h:]h;]h<]h=]h>]uh?Kph@hh+]r#hBX‰>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> conn.delete_table(table)r$…r%}r&(h0Uh1j ubaubhX)r'}r((h0X DynamoDB v2::r)h1j h2h3h4h[h6}r*(h<]h=]h;]h:]h>]uh?Kuh@hh+]r+hBX DynamoDB v2:r,…r-}r.(h0X DynamoDB v2:h1j'ubaubhš)r/}r0(h0X[>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> table.delete()h1j h2h3h4hh6}r1(h8h9h:]h;]h<]h=]h>]uh?Kwh@hh+]r2hBX[>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> table.delete()r3…r4}r5(h0Uh1j/ubaubeubhF)r6}r7(h0Uh1hGh2h3h4hIh6}r8(h<]h=]h;]h:]r9h$ah>]r:h auh?K}h@hh+]r;(hN)r<}r=(h0XCreating an Itemr>h1j6h2h3h4hRh6}r?(h<]h=]h;]h:]h>]uh?K}h@hh+]r@hBXCreating an ItemrA…rB}rC(h0j>h1j<ubaubhX)rD}rE(h0X DynamoDB v1::rFh1j6h2h3h4h[h6}rG(h<]h=]h;]h:]h>]uh?Kh@hh+]rHhBX DynamoDB v1:rI…rJ}rK(h0X DynamoDB v1:h1jDubaubhš)rL}rM(h0XÚ>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> item_data = { ... 'Body': 'http://url_to_lolcat.gif', ... 'SentBy': 'User A', ... 'ReceivedTime': '12/9/2011 11:36:03 PM', ... } >>> item = table.new_item( ... # Our hash key is 'forum' ... hash_key='LOLCat Forum', ... # Our range key is 'subject' ... range_key='Check this out!', ... # This has the ... attrs=item_data ... )h1j6h2h3h4hh6}rN(h8h9h:]h;]h<]h=]h>]uh?Kh@hh+]rOhBXÚ>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> item_data = { ... 'Body': 'http://url_to_lolcat.gif', ... 'SentBy': 'User A', ... 'ReceivedTime': '12/9/2011 11:36:03 PM', ... } >>> item = table.new_item( ... # Our hash key is 'forum' ... hash_key='LOLCat Forum', ... # Our range key is 'subject' ... range_key='Check this out!', ... # This has the ... attrs=item_data ... )rP…rQ}rR(h0Uh1jLubaubhX)rS}rT(h0X DynamoDB v2::rUh1j6h2h3h4h[h6}rV(h<]h=]h;]h:]h>]uh?K’h@hh+]rWhBX DynamoDB v2:rX…rY}rZ(h0X DynamoDB v2:h1jSubaubhš)r[}r\(h0X5>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> item = table.put_item(data={ ... 'forum_name': 'LOLCat Forum', ... 'subject': 'Check this out!', ... 'Body': 'http://url_to_lolcat.gif', ... 'SentBy': 'User A', ... 'ReceivedTime': '12/9/2011 11:36:03 PM', ... })h1j6h2h3h4hh6}r](h8h9h:]h;]h<]h=]h>]uh?K”h@hh+]r^hBX5>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> item = table.put_item(data={ ... 'forum_name': 'LOLCat Forum', ... 'subject': 'Check this out!', ... 'Body': 'http://url_to_lolcat.gif', ... 'SentBy': 'User A', ... 'ReceivedTime': '12/9/2011 11:36:03 PM', ... })r_…r`}ra(h0Uh1j[ubaubeubhF)rb}rc(h0Uh1hGh2h3h4hIh6}rd(h<]h=]h;]h:]reh#ah>]rfh auh?K h@hh+]rg(hN)rh}ri(h0XGetting an Existing Itemrjh1jbh2h3h4hRh6}rk(h<]h=]h;]h:]h>]uh?K h@hh+]rlhBXGetting an Existing Itemrm…rn}ro(h0jjh1jhubaubhX)rp}rq(h0X DynamoDB v1::rrh1jbh2h3h4h[h6}rs(h<]h=]h;]h:]h>]uh?K¢h@hh+]rthBX DynamoDB v1:ru…rv}rw(h0X DynamoDB v1:h1jpubaubhš)rx}ry(h0XŒ>>> table = conn.get_table('messages') >>> item = table.get_item( ... hash_key='LOLCat Forum', ... range_key='Check this out!' ... )h1jbh2h3h4hh6}rz(h8h9h:]h;]h<]h=]h>]uh?K¤h@hh+]r{hBXŒ>>> table = conn.get_table('messages') >>> item = table.get_item( ... hash_key='LOLCat Forum', ... range_key='Check this out!' ... )r|…r}}r~(h0Uh1jxubaubhX)r}r€(h0X DynamoDB v2::rh1jbh2h3h4h[h6}r‚(h<]h=]h;]h:]h>]uh?Kªh@hh+]rƒhBX DynamoDB v2:r„…r…}r†(h0X DynamoDB v2:h1jubaubhš)r‡}rˆ(h0Xƒ>>> table = Table('messages') >>> item = table.get_item( ... forum_name='LOLCat Forum', ... subject='Check this out!' ... )h1jbh2h3h4hh6}r‰(h8h9h:]h;]h<]h=]h>]uh?K¬h@hh+]rŠhBXƒ>>> table = Table('messages') >>> item = table.get_item( ... forum_name='LOLCat Forum', ... subject='Check this out!' ... )r‹…rŒ}r(h0Uh1j‡ubaubeubhF)rŽ}r(h0Uh1hGh2h3h4hIh6}r(h<]h=]h;]h:]r‘h(ah>]r’hauh?K´h@hh+]r“(hN)r”}r•(h0XUpdating an Itemr–h1jŽh2h3h4hRh6}r—(h<]h=]h;]h:]h>]uh?K´h@hh+]r˜hBXUpdating an Itemr™…rš}r›(h0j–h1j”ubaubhX)rœ}r(h0X DynamoDB v1::ržh1jŽh2h3h4h[h6}rŸ(h<]h=]h;]h:]h>]uh?K¶h@hh+]r hBX DynamoDB v1:r¡…r¢}r£(h0X DynamoDB v1:h1jœubaubhš)r¤}r¥(h0XJ>>> item['a_new_key'] = 'testing' >>> del item['a_new_key'] >>> item.put()h1jŽh2h3h4hh6}r¦(h8h9h:]h;]h<]h=]h>]uh?K¸h@hh+]r§hBXJ>>> item['a_new_key'] = 'testing' >>> del item['a_new_key'] >>> item.put()r¨…r©}rª(h0Uh1j¤ubaubhX)r«}r¬(h0X DynamoDB v2::r­h1jŽh2h3h4h[h6}r®(h<]h=]h;]h:]h>]uh?K¼h@hh+]r¯hBX DynamoDB v2:r°…r±}r²(h0X DynamoDB v2:h1j«ubaubhš)r³}r´(h0Xö>>> item['a_new_key'] = 'testing' >>> del item['a_new_key'] # Conditional save, only if data hasn't changed. >>> item.save() # Forced full overwrite. >>> item.save(overwrite=True) # Partial update (only changed fields). >>> item.partial_save()h1jŽh2h3h4hh6}rµ(h8h9h:]h;]h<]h=]h>]uh?K¾h@hh+]r¶hBXö>>> item['a_new_key'] = 'testing' >>> del item['a_new_key'] # Conditional save, only if data hasn't changed. >>> item.save() # Forced full overwrite. >>> item.save(overwrite=True) # Partial update (only changed fields). >>> item.partial_save()r·…r¸}r¹(h0Uh1j³ubaubeubhF)rº}r»(h0Uh1hGh2h3h4hIh6}r¼(h<]h=]h;]h:]r½h ah>]r¾h auh?KÌh@hh+]r¿(hN)rÀ}rÁ(h0XDeleting an ItemrÂh1jºh2h3h4hRh6}rÃ(h<]h=]h;]h:]h>]uh?KÌh@hh+]rÄhBXDeleting an ItemrÅ…rÆ}rÇ(h0jÂh1jÀubaubhX)rÈ}rÉ(h0X DynamoDB v1::rÊh1jºh2h3h4h[h6}rË(h<]h=]h;]h:]h>]uh?KÎh@hh+]rÌhBX DynamoDB v1:rÍ…rÎ}rÏ(h0X DynamoDB v1:h1jÈubaubhš)rÐ}rÑ(h0X>>> item.delete()h1jºh2h3h4hh6}rÒ(h8h9h:]h;]h<]h=]h>]uh?KÐh@hh+]rÓhBX>>> item.delete()rÔ…rÕ}rÖ(h0Uh1jÐubaubhX)r×}rØ(h0X DynamoDB v2::rÙh1jºh2h3h4h[h6}rÚ(h<]h=]h;]h:]h>]uh?KÒh@hh+]rÛhBX DynamoDB v2:rÜ…rÝ}rÞ(h0X DynamoDB v2:h1j×ubaubhš)rß}rà(h0X>>> item.delete()h1jºh2h3h4hh6}rá(h8h9h:]h;]h<]h=]h>]uh?KÔh@hh+]râhBX>>> item.delete()rã…rä}rå(h0Uh1jßubaubeubhF)ræ}rç(h0Uh1hGh2h3h4hIh6}rè(h<]h=]h;]h:]réhah>]rêhauh?KØh@hh+]rë(hN)rì}rí(h0XQueryingrîh1jæh2h3h4hRh6}rï(h<]h=]h;]h:]h>]uh?KØh@hh+]rðhBXQueryingrñ…rò}ró(h0jîh1jìubaubhX)rô}rõ(h0X DynamoDB v1::röh1jæh2h3h4h[h6}r÷(h<]h=]h;]h:]h>]uh?KÚh@hh+]røhBX DynamoDB v1:rù…rú}rû(h0X DynamoDB v1:h1jôubaubhš)rü}rý(h0Xz>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> from boto.dynamodb.condition import BEGINS_WITH >>> items = table.query('Amazon DynamoDB', ... range_key_condition=BEGINS_WITH('DynamoDB'), ... request_limit=1, max_results=1) >>> for item in items: >>> print item['Body']h1jæh2h3h4hh6}rþ(h8h9h:]h;]h<]h=]h>]uh?KÜh@hh+]rÿhBXz>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> from boto.dynamodb.condition import BEGINS_WITH >>> items = table.query('Amazon DynamoDB', ... range_key_condition=BEGINS_WITH('DynamoDB'), ... request_limit=1, max_results=1) >>> for item in items: >>> print item['Body']r…r}r(h0Uh1jüubaubhX)r}r(h0X DynamoDB v2::rh1jæh2h3h4h[h6}r(h<]h=]h;]h:]h>]uh?Kæh@hh+]rhBX DynamoDB v2:r…r }r (h0X DynamoDB v2:h1jubaubhš)r }r (h0Xý>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> items = table.query_2( ... forum_name__eq='Amazon DynamoDB', ... subject__beginswith='DynamoDB', ... limit=1 ... ) >>> for item in items: >>> print item['Body']h1jæh2h3h4hh6}r (h8h9h:]h;]h<]h=]h>]uh?Kèh@hh+]rhBXý>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> items = table.query_2( ... forum_name__eq='Amazon DynamoDB', ... subject__beginswith='DynamoDB', ... limit=1 ... ) >>> for item in items: >>> print item['Body']r…r}r(h0Uh1j ubaubeubhF)r}r(h0Uh1hGh2h3h4hIh6}r(h<]h=]h;]h:]rh*ah>]rhauh?Kôh@hh+]r(hN)r}r(h0XScansrh1jh2h3h4hRh6}r(h<]h=]h;]h:]h>]uh?Kôh@hh+]rhBXScansr…r}r(h0jh1jubaubhX)r }r!(h0X DynamoDB v1::r"h1jh2h3h4h[h6}r#(h<]h=]h;]h:]h>]uh?Köh@hh+]r$hBX DynamoDB v1:r%…r&}r'(h0X DynamoDB v1:h1j ubaubhš)r(}r)(h0XÜ>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') # All items. >>> items = table.scan() # With a filter. >>> items = table.scan(scan_filter={'Replies': GT(0)})h1jh2h3h4hh6}r*(h8h9h:]h;]h<]h=]h>]uh?Køh@hh+]r+hBXÜ>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') # All items. >>> items = table.scan() # With a filter. >>> items = table.scan(scan_filter={'Replies': GT(0)})r,…r-}r.(h0Uh1j(ubaubhX)r/}r0(h0X DynamoDB v2::r1h1jh2h3h4h[h6}r2(h<]h=]h;]h:]h>]uh?Mh@hh+]r3hBX DynamoDB v2:r4…r5}r6(h0X DynamoDB v2:h1j/ubaubhš)r7}r8(h0X§>>> from boto.dynamodb2.table import Table >>> table = Table('messages') # All items. >>> items = table.scan() # With a filter. >>> items = table.scan(replies__gt=0)h1jh2h3h4hh6}r9(h8h9h:]h;]h<]h=]h>]uh?Mh@hh+]r:hBX§>>> from boto.dynamodb2.table import Table >>> table = Table('messages') # All items. >>> items = table.scan() # With a filter. >>> items = table.scan(replies__gt=0)r;…r<}r=(h0Uh1j7ubaubeubhF)r>}r?(h0Uh1hGh2h3h4hIh6}r@(h<]h=]h;]h:]rAh)ah>]rBhauh?Mh@hh+]rC(hN)rD}rE(h0X Batch GetsrFh1j>h2h3h4hRh6}rG(h<]h=]h;]h:]h>]uh?Mh@hh+]rHhBX Batch GetsrI…rJ}rK(h0jFh1jDubaubhX)rL}rM(h0X DynamoDB v1::rNh1j>h2h3h4h[h6}rO(h<]h=]h;]h:]h>]uh?Mh@hh+]rPhBX DynamoDB v1:rQ…rR}rS(h0X DynamoDB v1:h1jLubaubhš)rT}rU(h0X#>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> from boto.dynamodb.batch import BatchList >>> the_batch = BatchList(conn) >>> the_batch.add_batch(table, keys=[ ... ('LOLCat Forum', 'Check this out!'), ... ('LOLCat Forum', 'I can haz docs?'), ... ('LOLCat Forum', 'Maru'), ... ]) >>> results = conn.batch_get_item(the_batch) # (Largely) Raw dictionaries back from DynamoDB. >>> for item_dict in response['Responses'][table.name]['Items']: ... print item_dict['Body']h1j>h2h3h4hh6}rV(h8h9h:]h;]h<]h=]h>]uh?Mh@hh+]rWhBX#>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> from boto.dynamodb.batch import BatchList >>> the_batch = BatchList(conn) >>> the_batch.add_batch(table, keys=[ ... ('LOLCat Forum', 'Check this out!'), ... ('LOLCat Forum', 'I can haz docs?'), ... ('LOLCat Forum', 'Maru'), ... ]) >>> results = conn.batch_get_item(the_batch) # (Largely) Raw dictionaries back from DynamoDB. >>> for item_dict in response['Responses'][table.name]['Items']: ... print item_dict['Body']rX…rY}rZ(h0Uh1jTubaubhX)r[}r\(h0X DynamoDB v2::r]h1j>h2h3h4h[h6}r^(h<]h=]h;]h:]h>]uh?M#h@hh+]r_hBX DynamoDB v2:r`…ra}rb(h0X DynamoDB v2:h1j[ubaubhš)rc}rd(h0XÍ>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> results = table.batch_get(keys=[ ... {'forum_name': 'LOLCat Forum', 'subject': 'Check this out!'}, ... {'forum_name': 'LOLCat Forum', 'subject': 'I can haz docs?'}, ... {'forum_name': 'LOLCat Forum', 'subject': 'Maru'}, ... ]) # Lazy requests across pages, if paginated. >>> for res in results: ... # You get back actual ``Item`` instances. ... print item['Body']h1j>h2h3h4hh6}re(h8h9h:]h;]h<]h=]h>]uh?M%h@hh+]rfhBXÍ>>> from boto.dynamodb2.table import Table >>> table = Table('messages') >>> results = table.batch_get(keys=[ ... {'forum_name': 'LOLCat Forum', 'subject': 'Check this out!'}, ... {'forum_name': 'LOLCat Forum', 'subject': 'I can haz docs?'}, ... {'forum_name': 'LOLCat Forum', 'subject': 'Maru'}, ... ]) # Lazy requests across pages, if paginated. >>> for res in results: ... # You get back actual ``Item`` instances. ... print item['Body']rg…rh}ri(h0Uh1jcubaubeubhF)rj}rk(h0Uh1hGh2h3h4hIh6}rl(h<]h=]h;]h:]rmh'ah>]rnhauh?M4h@hh+]ro(hN)rp}rq(h0X Batch Writesrrh1jjh2h3h4hRh6}rs(h<]h=]h;]h:]h>]uh?M4h@hh+]rthBX Batch Writesru…rv}rw(h0jrh1jpubaubhX)rx}ry(h0X DynamoDB v1::rzh1jjh2h3h4h[h6}r{(h<]h=]h;]h:]h>]uh?M6h@hh+]r|hBX DynamoDB v1:r}…r~}r(h0X DynamoDB v1:h1jxubaubhš)r€}r(h0X½>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> from boto.dynamodb.batch import BatchWriteList >>> from boto.dynamodb.item import Item # You must manually manage this so that your total ``puts/deletes`` don't # exceed 25. >>> the_batch = BatchList(conn) >>> the_batch.add_batch(table, puts=[ ... Item(table, 'Corgi Fanciers', 'Sploots!', { ... 'Body': 'Post your favorite corgi-on-the-floor shots!', ... 'SentBy': 'User B', ... 'ReceivedTime': '2013/05/02 10:56:45 AM', ... }), ... Item(table, 'Corgi Fanciers', 'Maximum FRAPS', { ... 'Body': 'http://internetvideosite/watch?v=1247869', ... 'SentBy': 'User C', ... 'ReceivedTime': '2013/05/01 09:15:25 PM', ... }), ... ], deletes=[ ... ('LOLCat Forum', 'Off-topic post'), ... ('LOLCat Forum', 'They be stealin mah bukket!'), ... ]) >>> conn.batch_write_item(the_writes)h1jjh2h3h4hh6}r‚(h8h9h:]h;]h<]h=]h>]uh?M8h@hh+]rƒhBX½>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region() >>> table = conn.get_table('messages') >>> from boto.dynamodb.batch import BatchWriteList >>> from boto.dynamodb.item import Item # You must manually manage this so that your total ``puts/deletes`` don't # exceed 25. >>> the_batch = BatchList(conn) >>> the_batch.add_batch(table, puts=[ ... Item(table, 'Corgi Fanciers', 'Sploots!', { ... 'Body': 'Post your favorite corgi-on-the-floor shots!', ... 'SentBy': 'User B', ... 'ReceivedTime': '2013/05/02 10:56:45 AM', ... }), ... Item(table, 'Corgi Fanciers', 'Maximum FRAPS', { ... 'Body': 'http://internetvideosite/watch?v=1247869', ... 'SentBy': 'User C', ... 'ReceivedTime': '2013/05/01 09:15:25 PM', ... }), ... ], deletes=[ ... ('LOLCat Forum', 'Off-topic post'), ... ('LOLCat Forum', 'They be stealin mah bukket!'), ... ]) >>> conn.batch_write_item(the_writes)r„…r…}r†(h0Uh1j€ubaubhX)r‡}rˆ(h0X DynamoDB v2::r‰h1jjh2h3h4h[h6}rŠ(h<]h=]h;]h:]h>]uh?MRh@hh+]r‹hBX DynamoDB v2:rŒ…r}rŽ(h0X DynamoDB v2:h1j‡ubaubhš)r}r(h0XË>>> from boto.dynamodb2.table import Table >>> table = Table('messages') # Uses a context manager, which also automatically handles batch sizes. >>> with table.batch_write() as batch: ... batch.delete_item( ... forum_name='LOLCat Forum', ... subject='Off-topic post' ... ) ... batch.put_item(data={ ... 'forum_name': 'Corgi Fanciers', ... 'subject': 'Sploots!', ... 'Body': 'Post your favorite corgi-on-the-floor shots!', ... 'SentBy': 'User B', ... 'ReceivedTime': '2013/05/02 10:56:45 AM', ... }) ... batch.put_item(data={ ... 'forum_name': 'Corgi Fanciers', ... 'subject': 'Sploots!', ... 'Body': 'Post your favorite corgi-on-the-floor shots!', ... 'SentBy': 'User B', ... 'ReceivedTime': '2013/05/02 10:56:45 AM', ... }) ... batch.delete_item( ... forum_name='LOLCat Forum', ... subject='They be stealin mah bukket!' ... )h1jjh2h3h4hh6}r‘(h8h9h:]h;]h<]h=]h>]uh?MTh@hh+]r’hBXË>>> from boto.dynamodb2.table import Table >>> table = Table('messages') # Uses a context manager, which also automatically handles batch sizes. >>> with table.batch_write() as batch: ... batch.delete_item( ... forum_name='LOLCat Forum', ... subject='Off-topic post' ... ) ... batch.put_item(data={ ... 'forum_name': 'Corgi Fanciers', ... 'subject': 'Sploots!', ... 'Body': 'Post your favorite corgi-on-the-floor shots!', ... 'SentBy': 'User B', ... 'ReceivedTime': '2013/05/02 10:56:45 AM', ... }) ... batch.put_item(data={ ... 'forum_name': 'Corgi Fanciers', ... 'subject': 'Sploots!', ... 'Body': 'Post your favorite corgi-on-the-floor shots!', ... 'SentBy': 'User B', ... 'ReceivedTime': '2013/05/02 10:56:45 AM', ... }) ... batch.delete_item( ... forum_name='LOLCat Forum', ... subject='They be stealin mah bukket!' ... )r“…r”}r•(h0Uh1jubaubeubeubeh0UU transformerr–NU footnote_refsr—}r˜Urefnamesr™}ršXdynamodb]r›hbasUsymbol_footnotesrœ]rUautofootnote_refsrž]rŸUsymbol_footnote_refsr ]r¡U citationsr¢]r£h@hU current_liner¤NUtransform_messagesr¥]r¦Ureporterr§NUid_startr¨KU autofootnotesr©]rªU citation_refsr«}r¬Uindirect_targetsr­]r®Usettingsr¯(cdocutils.frontend Values r°or±}r²(Ufootnote_backlinksr³KUrecord_dependenciesr´NU rfc_base_urlrµUhttp://tools.ietf.org/html/r¶U tracebackr·ˆUpep_referencesr¸NUstrip_commentsr¹NU toc_backlinksrºUentryr»U language_coder¼Uenr½U datestampr¾NU report_levelr¿KU _destinationrÀNU halt_levelrÁKU strip_classesrÂNhRNUerror_encoding_error_handlerrÃUbackslashreplacerÄUdebugrÅNUembed_stylesheetrƉUoutput_encoding_error_handlerrÇUstrictrÈU sectnum_xformrÉKUdump_transformsrÊNU docinfo_xformrËKUwarning_streamrÌNUpep_file_url_templaterÍUpep-%04drÎUexit_status_levelrÏKUconfigrÐNUstrict_visitorrÑNUcloak_email_addressesrÒˆUtrim_footnote_reference_spacerÓ‰UenvrÔNUdump_pseudo_xmlrÕNUexpose_internalsrÖNUsectsubtitle_xformr׉U source_linkrØNUrfc_referencesrÙNUoutput_encodingrÚUutf-8rÛU source_urlrÜNUinput_encodingrÝU utf-8-sigrÞU_disable_configrßNU id_prefixràUU tab_widthráKUerror_encodingrâUUTF-8rãU_sourceräh3Ugettext_compactråˆU generatorræNUdump_internalsrçNU smart_quotesrè‰U pep_base_urlréUhttp://www.python.org/dev/peps/rêUsyntax_highlightrëUlongrìUinput_encoding_error_handlerríjÈUauto_id_prefixrîUidrïUdoctitle_xformrð‰Ustrip_elements_with_classesrñNU _config_filesrò]Ufile_insertion_enabledróˆU raw_enabledrôKU dump_settingsrõNubUsymbol_footnote_startröKUidsr÷}rø(h)j>hjæh(jŽh$j6h!j h&hÞh"h}hh„h#jbh jºhh²h*jh'jjh%hGuUsubstitution_namesrù}rúh4h@h6}rû(h<]h:]h;]Usourceh3h=]h>]uU footnotesrü]rýUrefidsrþ}rÿub.