LSIμ κ²½μ° create-table
νΈμΆμ --local-secondary-indexes 'IndexName=string,KeySchema=[{AttributeName=string,KeyType=string},{AttributeName=string,KeyType=string}],Projection={ProjectionType=string,NonKeyAttributes=[string,string]}'
λ₯Ό μ¬μ©ν©λλ€.
μ¬μ ν λ¬Έμ κ° μλ κ²½μ° λΉν°λ£ΈμΌλ‘ μμ μ±ν νμμμ€. gitterμ μ°¬μ±νμ¬ λ§κ°ν©λλ€.
μλ νμΈμ μ μμ€,
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' ꡬ문 λΆμ μ€λ₯: μμ: '=', μμ : ''
' μ
λ ₯:
'μμΈμ΄λ¦=λ¬Έμμ΄,ν€μ€ν€λ§=[{μμ±μ΄λ¦=μ±λ³,ν€μ ν=λ²μ},{μμ±μ΄λ¦=
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={ νλ‘μ μ μ ν=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={ νλ‘μ μ μ ν=ALL}'