AWS SDK for .NET Documentation
ScanRequest Class
AmazonAmazon.DynamoDB.ModelScanRequest Did this page help you?   Yes   No    Tell us about it...
Container for the parameters to the Scan operation.

Retrieves one or more items and its attributes by performing a full scan of a table.

Provide a ScanFilter to get more specific results.

Declaration Syntax
public class ScanRequest : AmazonWebServiceRequest
All MembersConstructorsMethodsProperties

Initializes a new instance of the ScanRequest class

List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.


1 -

If set to true, Amazon DynamoDB returns a total number of items for the Scan operation, even if the operation has no matching items for the assigned filter. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.

Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Primary key of the item from which to continue an earlier scan. An earlier scan might provide this value if that scan operation was interrupted before scanning the entire table; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new scan request to continue the operation from that point.

Serves as a hash function for a particular type.
(Inherited from Object.)
Gets the type of the current instance.
(Inherited from Object.)
The maximum number of items to return. If Amazon DynamoDB hits this limit while scanning the table, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan. Also, if the scanned data set size exceeds 1 MB before Amazon DynamoDB hits this limit, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan.


1 -

Evaluates the scan results and returns only the desired values.

The name of the table in which you want to scan. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).


3 - 255

Returns a string that represents the current object.
(Inherited from Object.)
WithAttributesToGet(array<String>[]()[][]) Obsolete.
Adds elements to the AttributesToGet collection

WithAttributesToGet(IEnumerable<(Of <<'(String>)>>)) Obsolete.
Adds elements to the AttributesToGet collection

WithCount(Boolean) Obsolete.
Sets the Count property

WithExclusiveStartKey(Key) Obsolete.
Sets the ExclusiveStartKey property

WithLimit(Int32) Obsolete.
Sets the Limit property

WithScanFilter(array<KeyValuePair<(Of <<'(String, Condition>)>>)>[]()[][]) Obsolete.
Adds the KeyValuePairs to the ScanFilter dictionary.

WithTableName(String) Obsolete.
Sets the TableName property


The following example shows how to scan items in a table.
Note: the Scan operation goes through every item in the table to check if the item matches all the scan conditions. This makes the Scan operation particularly slow and expensive (in terms of provisioned throughput).
We will now retrieve all items where the Pages attribute is greater than the numerical value "200" and where the Title attribute contains the string "Adventures".

CopyScan sample
// Create a client
AmazonDynamoDBClient client = new AmazonDynamoDBClient();

// Define scan conditions
Dictionary<string, Condition> conditions = new Dictionary<string,Condition>();

// Title attribute should contain the string "Adventures"
Condition titleCondition = new Condition();
titleCondition.WithAttributeValueList(new AttributeValue { S = "Adventures"});
conditions["Title"] = titleCondition;

// Pages attributes must be greater-than the numeric value "200"
Condition pagesCondition = new Condition();
pagesCondition.WithAttributeValueList(new AttributeValue { N = "200"});
conditions["Pages"] = pagesCondition;

// Define marker variable
Key startKey = null;

    // Create Scan request
    ScanRequest request = new ScanRequest
        TableName = "SampleTable",
        ExclusiveStartKey = startKey,
        ScanFilter = conditions

    // Issue request
    ScanResult result = client.Scan(request).ScanResult;

    // View all returned items
    List<Dictionary<string, AttributeValue>> items = result.Items;
    foreach (Dictionary<string, AttributeValue> item in items)
        foreach (var keyValuePair in item)
            Console.WriteLine("{0} : S={1}, N={2}, SS=[{3}], NS=[{4}]",
                string.Join(", ", keyValuePair.Value.SS.ToArray()),
                string.Join(", ", keyValuePair.Value.SS.ToArray()));

    // Set marker variable
    startKey = result.LastEvaluatedKey;
} while (startKey != null);
Inheritance Hierarchy
See Also

Assembly: AWSSDK (Module: AWSSDK) Version: (