using c#, the code is like this
DynamoDBContext context = new DynamoDBContext(client, new DynamoDBContextConfig() { TableNamePrefix = "lalala" });
QueryFilter filter = new QueryFilter();
filter.AddCondition("Userid", QueryOperator.Equal, "hashkeyvalue");
QueryOperationConfig queryConfig = new QueryOperationConfig
{
Filter = filter,
Select = SelectValues.AllProjectedAttributes,
Limit = 1,
IndexName = "Userid-UpdatedAtTimestamp-index"
};
try
{
var result = await context.FromQueryAsync<IAPRecord>(queryConfig).GetRemainingAsync();
int ccc = result.Count;
}
catch (Exception ex)
{
throw new ArgumentException(ex.Message + ex.InnerException);
}
and ccc should be 1 but now it equal to the whole set as if the Limit=1 doesn't exist.
Need helps!!
resolved.
var query = context.FromQueryAsync<IAPRecord>(queryConfig);
var result = await query.GetNextSetAsync();
int ccc = result.Count;
Apparently GetRemainingAsync will get all the results regardless of how many you set to the limit parameter in the query. Instead, we should have use GetNextSetAsync.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With