编程语言
首页 > 编程语言> > c#-如何从Amazon Simple DB检索100多个记录

c#-如何从Amazon Simple DB检索100多个记录

作者:互联网

我正在MVC中创建应用程序,并将Amazon云服务用于后端.我需要像这样从数据库中批量购买数据,所以我正在使用像这样的查询-

  SelectResponse response = simpleDBClient.Select(new SelectRequest()
  {
      SelectExpression =  "select * from survey1 limit 2400"

  });

现在工作正常,并返回2400条记录.现在,我想对这些记录应用搜索,因此必须使用where子句,但是当我使用where子句时,在任何有效条件下,它仅返回10条记录.

请帮助我,任何帮助将不胜感激.

解决方法:

您可以在where子句中使用limit.有关更多详细信息,请参见“选择查询”的语法-

select output_list from domain_name [where expression] [sort_instructions] [limit limit]

output_list可以是:,itemName(),count(),属性列表

> *用于所有属性.
>`itemName()`仅用于商品名称.
> count(*)表示项目总数与查询表达式匹配.它将返回结果集中的项目数,而不是返回项目.
>明确的属性列表(attribute1,…,attributeN)

domain_name是您要从中搜索项目的域.

该表达式是项目的匹配表达式.您可以使用选择表达式,例如=,< =,<,>. =,之间不一样,为null,不为null等.

sort_instructions将结果按单个属性按升序或降序排序.

限制是要返回的最大结果数(默认值:100,最大2500).

请注意-

The total size of the response cannot exceed 1 MB. Amazon SimpleDB
automatically adjusts the number of items returned per page to enforce
this limit. For example, even if you ask to retrieve 2500 items, but
each individual item is 10 KB in size, the system returns 100 items
and an appropriate next token so you can get the next page of results.

Note: Operations that run longer than 5 seconds return a time-out
error response or a partial or empty result set. Partial and empty
result sets contain a NextToken value, which allows you to continue
the operation from where it left off.

Source

标签:amazon-simpledb,c
来源: https://codeday.me/bug/20191029/1963172.html