1

これが私のモデル定義です:

var Notification = vogels.define('Notification', {
    tableName: 'notification',
    hashKey: 'notification_id',
    rangeKey: 'createdAt',
    timestamps: true,
    schema: {
        notification_id : vogels.types.uuid(),
        badge: joi.number().integer(),
        delay: joi.number(),
        action: joi.string(),
        body: joi.string(),
        tags: vogels.types.stringSet()
    },
    indexes: [{
        hashKey : 'tags',
        rangeKey: 'createdAt',
        name : 'TagsIndex',
        type : 'global'
    }]
});

ただし、このテーブルを作成しようとすると、次のエラーが発生します。

Error creating tables:  { [ValidationException: Member must satisfy enum value set: [B, N, S]]
  message: 'Member must satisfy enum value set: [B, N, S]',
  code: 'ValidationException',
  time: Thu May 12 2016 14:06:44 GMT-0700 (PDT),
  requestId: 'c775c989-c723-4d55-b319-731230a5991b',
  statusCode: 400,
  retryable: false,
  retryDelay: 0 }

問題は、index. それを削除すると、正常に動作します。

4

1 に答える 1

0

Hash/Hash-Range キーでSET データ型を使用できないため、エラーが発生しました。

エラーが示唆しているキーには、文字列、数値、およびバイナリ データ型のみを使用できます。

ドキュメンテーション リンクには、set を使用できないことが明確に記載されています。

それが役立つことを願っています。

于 2016-05-13T06:18:36.197 に答える