lundi 23 mars 2015

Dynamodb queries with more than one value for atribute

How can I make a query using more than one value? For example, all users with last_name ["Doggett","Scully","Mulder"]


Example using boto.



Table.create('users',
schema=[
HashKey('id') # defaults to STRING data_type
], throughput={
'read': 5,
'write': 15,
}, global_indexes=[
GlobalAllIndex('LastnameTimeIndex', parts=[
HashKey('last_name'),
RangeKey('creation_date', data_type=NUMBER),
],
throughput={
'read': 1,
'write': 1,
}),
],
connection=conn
)


something like:



table = Table("users", connections=conn)
table.query_2(last_name__in=["Doggett","Scully","Mulder"], connection=conn)




Aucun commentaire:

Enregistrer un commentaire