بالنسبة إلى LSI ، يمكنك استخدام --local-secondary-indexes 'IndexName=string,KeySchema=[{AttributeName=string,KeyType=string},{AttributeName=string,KeyType=string}],Projection={ProjectionType=string,NonKeyAttributes=[string,string]}'
في مكالمتك create-table
.
إذا كنت لا تزال تواجه مشكلات ، فتفضل بالدردشة معنا في غرفة النوم لدينا. إغلاق لصالح gitter.
مرحبًا Jamesls ،
aws dynamodb create-table --table-name XYZ - تعريفات السمة AttributeName = Id، AttributeType = N AttributeName = Name، AttributeType = S AttributeName = Gender، AttributeType = S - key-schema AttributeName = Id، KeyType = HASH AttributeName = الاسم ، KeyType = RANGE - توفير معدل نقل البيانات ReadCapacityUnits = 5 ، WriteCapacityUnits = 5 - اسم الفهرس المحلي - الثانوي - الفهرس = سلسلة ، KeySchema = [{AttributeName = Gender، KeyType = RANGE} ، {AttributName = Id، KeyType = HASH}] ، الإسقاط = {ProjectionType = ALL} '
لقد استخدمت الكود أعلاه لإنشاء جدول. لكني أتلقى الخطأ:
_Error تحليل المعلمة '--local-Secondary-indexes': المتوقع: '=' ، المستلمة: "
للإدخال:
'IndexName = string، KeySchema = [{AttributeName = Gender، KeyType = RANGE}، {AttributName =
المعرّف ، KeyType = HASH}] ، الإسقاط = {ProjectionType = ALL} '_
شكرا لدعمك
aws dynamodb create-table --table-name XYZ - تعريفات السمة 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 = { نوع الإسقاط = الكل} '
التعليق الأكثر فائدة
aws dynamodb create-table --table-name XYZ - تعريفات السمة 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 = { نوع الإسقاط = الكل} '