Model.scan(filter, options, callback)

Scans a table. The optional filter parameter can either be an attribute of the table or a complete filter object. If the callback is provided, the exec command is called automatically, and the scan parameter must be a Scan object.

Dog.scan('breed').contains('Terrier').exec(function (err, dogs) {
  // Look at all the Terriers
Dog.scan({breed: {contains: 'Terrier'} }, function (err, dogs) {
  // Look at all the Terriers

To get all the items in a table, do not provide a filter.

Dog.scan().exec(function (err, dogs) {
  // Look at all the dogs
  if(dogs.lastKey) { // More dogs to get
    Dog.scan().startAt(dogs.lastKey).exec(function (err, dogs) {
      // Look more dogs

To use the raw AWS filter in scanning especially for nested fields scan purposes, compose the filter object and pass it in.

  • The TableName field in raw filter is not necessary to be specified. If it is left blank, the model name will be used as default table name.
var Dog = dynamoose.model('Dog');
// this should be composed, ref:
var filter = {
  FilterExpression: 'details.timeWakeUp = :wakeUp',
  ExpressionAttributeValues: {
    ':wakeUp': '8am'

  .then(function(dogs) {
  .catch(function(err) {


Executes a scan against a table

scan.all([delay[, max]])

Recursively scan as long as lastKey exists. This function will also return a property called timesScanned indicating how many scans were completed.

delay is the time (in miliseconds) between recursive scans. Default: 1000ms (1sec)

max is the maximum number of recursive scans. Default: 0 - unlimited


Preforms a parallel scan on the table.

totalSegments is the number of parallel scans

The results will be merged into a single array. .lastKey will be an array of lastKey objects.

Warning this can consume a lot of capacity.


For readability only. Scans us AND logic for multiple attributes. and() does not provide any functionality and can be omitted.

scan.where(filter) | scan.filter(filter)

Add additional attribute to the filter list.


Inverts the filter logic that follows.


Scan attribute for null.


Attribute is equal to the value. If null, undefined, or a empty string is passed as the value, scan.null() is called.

Attribute is less than the value.


Attribute is less than or equal value.

Attribute is greater than or equal value.

Attribute is greater than the value.


Attribute contains the value.


Attribute begins with the value.

Attribute is in values array.

scan.between(a, b)

Attribute value is greater than or equal a. and less than or equal to b.


The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in lastKey to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed data set size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in lastKey to apply in a subsequent operation to continue the operation. For more information, see Query and Scan in the Amazon DynamoDB Developer Guide.


Start scan at key. Use lastKey returned in scan.exec() callback.


Set the list of attributes to return.


Return the number of matching items, rather than the matching items themselves.


Return the counts object of matching items, rather than the matching items themselves:

    "count": 2,
    "scannedCount": 1000

If you used a filter in the scan, then count is the number of items returned after the filter was applied, and scannedCount is the number of matching items before the filter was applied.


Scan with consistent read.


Scan can be performed on a sparse index instead of the entire table. To scan an index you have to manually specify which index to use by adding the scan.using method to your scan chain. The string you pass into the scan.using method must match the name of an index on your table. Unlike query, this method is required for index scanning.