Dynamodb的复合键

时间:2018-11-30 07:49:33

标签: amazon-web-services amazon-dynamodb

我有以下架构:

var ClientFeature = dynamo.define('ClientFeature', {
  hashKey : 'client',
  rangeKey: 'feature',
  schema : {
    client: Joi.string(), //Foreign key to service
    feature: Joi.string(), //Foreign Key to Feature
    date: Joi.date() //Date created
  }
});

var User = dynamo.define('User', {
  hashKey: 'client',
  rangeKey: 'email',
  schema : {
    email : Joi.string().email(),
    client: Joi.string(),
    type: Joi.string(),
    password : Joi.string()
  },
  indexes : [{
    hashKey : 'email', rangeKey : 'password', name : 'EmailPasswordIndex', type : 'global', projection: { NonKeyAttributes: [ 'type' ], ProjectionType: 'INCLUDE' }
  }]
});

现在,我正在使用此表category创建两者的汇总。问题是我想要category表中两个表中的两个主键,但是,两个表都有复合键(hashKey和rangeKey),它们的总和为2 ^ 4 = 16个全局索引。 Dynamodb(Amazon AWS)仅支持5个索引。有什么建议吗?

0 个答案:

没有答案