简体   繁体   English

Salesforce SOQL在REST API中设置批量大小

[英]Salesforce SOQL set batchsize in REST api

Is there a way to set the batch size to 2000 (maximum)? 有没有办法将批量大小设置为2000(最大)? I know it is possible via soap API by adding an option: see here 我知道可以通过soap API添加一个选项: 见这里

Is there a way to achieve this via REST API POST request? 有没有办法通过REST API POST请求实现这一点?

You can set the REST batch size using option headers: 您可以使用选项标头设置REST批处理大小:

Field name 字段名称

Sforce-Query-Options Sforce查询选项

Field values 字段值

batchSize — A numeric value that specifies the number of records returned for a query request. batchSize - 一个数值,指定为查询请求返回的记录数。 Child objects count toward the number of records for the batch size. 子对象计入批量大小的记录数。 For example, in relationship queries, multiple child objects may be returned per parent row returned. 例如,在关系查询中,可以返回每个父行返回的多个子对象。 The default is 2,000; 默认值为2,000; the minimum is 200, and the maximum is 2,000. 最小值为200,最大值为2,000。 There is no guarantee that the requested batch size will be the actual batch size; 无法保证所请求的批量大小是实际批量大小; this is done to maximize performance. 这样做是为了最大化性能。

Example

Sforce-Query-Options: batchSize=1000 Sforce-Query-Options:batchSize = 1000

Docs: http://www.salesforce.com/us/developer/docs/api_rest/Content/headers_queryoptions.htm 文档: http //www.salesforce.com/us/developer/docs/api_rest/Content/headers_queryoptions.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM