ΠΠ»Ρ LSI Π²Ρ Π΄ΠΎΠ»ΠΆΠ½Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ --local-secondary-indexes 'IndexName=string,KeySchema=[{AttributeName=string,KeyType=string},{AttributeName=string,KeyType=string}],Projection={ProjectionType=string,NonKeyAttributes=[string,string]}'
Π² Π²ΡΠ·ΠΎΠ²Π΅ create-table
.
ΠΡΠ»ΠΈ Ρ Π²Π°Ρ Π²ΡΠ΅ Π΅ΡΠ΅ Π΅ΡΡΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ, ΠΏΡΠΈΡ ΠΎΠ΄ΠΈΡΠ΅ ΠΏΠΎΠΎΠ±ΡΠ°ΡΡΡΡ Ρ Π½Π°ΠΌΠΈ Π² Π½Π°ΡΡ Π³ΠΎΡΡΠΈΠ½ΡΡ. ΠΠΎΠ²ΡΠΎΡΡΡΡ Π² ΠΏΠΎΠ»ΡΠ·Ρ ΠΠΈΡΡΠ΅ΡΠ°.
ΠΡΠΈΠ²Π΅Ρ, ΠΠΆΠ΅ΠΉΠΌΡ,
aws Dynamodb create-table --table-name XYZ --attribute-definitions AttributeName = Id, AttributeType = N AttributeName = Name, AttributeType = S AttributeName = Gender, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Name, KeyType = RANGE --provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secondary-indexes 'IndexName = string, KeySchema = [{AttributeName = Gender, KeyType = RANGE}, {AttributName = Id, KeyType = HASH}], Projection = {ProjectionType = ALL} '
Π― ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π» ΠΏΡΠΈΠ²Π΅Π΄Π΅Π½Π½ΡΠΉ Π²ΡΡΠ΅ ΠΊΠΎΠ΄ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΡΠ°Π±Π»ΠΈΡΡ. ΠΠΎ Ρ ΠΏΠΎΠ»ΡΡΠ°Ρ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ ΠΎΠ± ΠΎΡΠΈΠ±ΠΊΠ΅:
_ ΠΠ°ΡΠ°ΠΌΠ΅ΡΡ ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ Π°Π½Π°Π»ΠΈΠ·Π° ΠΎΡΠΈΠ±ΠΊΠΈ '--local-secondary-indexes': ΠΠΆΠΈΠ΄Π°Π΅ΡΡΡ: '=', ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΎ: ''
'Π΄Π»Ρ Π²Π²ΠΎΠ΄Π°:
'IndexName = ΡΡΡΠΎΠΊΠ°, KeySchema = [{AttributeName = Gender, KeyType = RANGE}, {AttributName =
Id, KeyType = HASH}], Projection = {ProjectionType = ALL} '_
Π‘ΠΏΠ°ΡΠΈΠ±ΠΎ Π·Π° ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΡ
aws Dynamodb create-table --table-name XYZ --attribute-definitions AttributeName = Id, AttributeType = N AttributeName = Name, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Name, KeyType = RANGE - -provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secondary-indexes 'IndexName = idx1, KeySchema = [{AttributeName = Id, KeyType = HASH}, {AttributeName = Name, KeyType = RANGE}], Projection = { ProjectionType = ALL} '
Π‘Π°ΠΌΡΠΉ ΠΏΠΎΠ»Π΅Π·Π½ΡΠΉ ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΉ
aws Dynamodb create-table --table-name XYZ --attribute-definitions AttributeName = Id, AttributeType = N AttributeName = Name, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Name, KeyType = RANGE - -provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secondary-indexes 'IndexName = idx1, KeySchema = [{AttributeName = Id, KeyType = HASH}, {AttributeName = Name, KeyType = RANGE}], Projection = { ProjectionType = ALL} '