小编And*_*xon的帖子

.net通过DynamoDBContext查询DynamoDB中的全局二级索引

我有一个dynamoDB表,其架构如下:

var request = new CreateTableRequest
{
    TableName = tableName,
    KeySchema = new List<KeySchemaElement>
    {
        new KeySchemaElement("CompanyId", KeyType.HASH),
        new KeySchemaElement("Timestamp", KeyType.RANGE)
    },
    AttributeDefinitions = new List<AttributeDefinition>
    {
        new AttributeDefinition("CompanyId", ScalarAttributeType.S),
        new AttributeDefinition("Timestamp", ScalarAttributeType.N),
        new AttributeDefinition("UserId", ScalarAttributeType.S)
    },
    GlobalSecondaryIndexes = new List<GlobalSecondaryIndex>
    {
        new GlobalSecondaryIndex
        {
            IndexName = "UserIndex",
            KeySchema = new List<KeySchemaElement>
            {
                new KeySchemaElement("UserId", KeyType.HASH),
                new KeySchemaElement("Timestamp", KeyType.RANGE)
            },
            Projection = new Projection {ProjectionType = "ALL"},
            ProvisionedThroughput = new ProvisionedThroughput(5, 6)
        }
    },
    ProvisionedThroughput = new ProvisionedThroughput(5, 6)
}; …
Run Code Online (Sandbox Code Playgroud)

asp.net amazon-dynamodb

6
推荐指数
1
解决办法
740
查看次数

标签 统计

amazon-dynamodb ×1

asp.net ×1