src/Resources/DynamoDbTable.php
public function retrieveRecordsByFilter($table, $filter = null, $params = [], $extras = [])
    {
        $fields = array_get($extras, ApiOptions::FIELDS);
        $ssFilters = array_get($extras, 'ss_filters');

        $scanProperties = [static::TABLE_INDICATOR => $table];

        $fields = static::buildProjectionExpression($fields);
        if (!empty($fields)) {
            $scanProperties['ProjectionExpression'] = $fields;
        }

        $this->buildFilterExpression($filter, $params, $ssFilters, $scanProperties);

        $limit = intval(array_get($extras, ApiOptions::LIMIT));
        $maxAllowed = $this->getMaxRecordsReturnedLimit();
        if($limit < 1 || $limit > $maxAllowed){
            $limit = $maxAllowed;
        }
        if ($limit > 0) {
            $scanProperties['Limit'] = $limit;
            $scanProperties['Count'] = true;
        }
        $offset = intval(array_get($extras, ApiOptions::OFFSET));
        if ($offset > 0) {
            $scanProperties['ExclusiveStartKey'] = $offset;
            $scanProperties['Count'] = true;
        }

        try {
            $result = $this->getConnection()->scan($scanProperties);
            $items = (array)$result['Items'];

            $out = [];
            foreach ($items as $item) {
                $out[] = $this->unformatAttributes($item);
            }

            $next = $this->unformatAttributes($result['LastEvaluatedKey']);
            $next = current($next); // todo handle more than one index here.
            $count = $result['ScannedCount'];
            $out = static::cleanRecords($out);
            $needMore = ($limit > 0) ? (($count - $offset) > $limit) : false;
            $addCount = array_get_bool($extras, ApiOptions::INCLUDE_COUNT);
            if ($addCount || $needMore || $next) {
                $out['meta']['count'] = $count;
                if ($next) {
                    $out['meta']['next'] = $next;
                }
            }

            return $out;
        } catch (\Exception $ex) {
            throw new InternalServerErrorException("Failed to filter records from '$table'.\n{$ex->getMessage()}");
        }
    }
public function retrieveRecordsByFilter($table, $filter = null, $params = [], $extras = [])
    {
        $fields = array_get($extras, ApiOptions::FIELDS);
        $ssFilters = array_get($extras, 'ss_filters');

        $scanProperties = [static::TABLE_INDICATOR => $table];

        $fields = static::buildProjectionExpression($fields);
        if (!empty($fields)) {
            $scanProperties['ProjectionExpression'] = $fields;
        }

        $this->buildFilterExpression($filter, $params, $ssFilters, $scanProperties);

        $limit = intval(array_get($extras, ApiOptions::LIMIT));
        $maxAllowed = $this->getMaxRecordsReturnedLimit();
        if($limit < 1 || $limit > $maxAllowed){
            $limit = $maxAllowed;
        }
        if ($limit > 0) {
            $scanProperties['Limit'] = $limit;
            $scanProperties['Count'] = true;
        }
        $offset = intval(array_get($extras, ApiOptions::OFFSET));
        if ($offset > 0) {
            $scanProperties['ExclusiveStartKey'] = $offset;
            $scanProperties['Count'] = true;
        }

        try {
            $result = $this->getConnection()->scan($scanProperties);
            $items = (array)$result['Items'];

            $out = [];
            foreach ($items as $item) {
                $out[] = $this->unformatAttributes($item);
            }

            $next = $this->unformatAttributes($result['LastEvaluatedKey']);
            $next = current($next); // todo handle more than one index here.
            $count = $result['ScannedCount'];
            $out = static::cleanRecords($out);
            $needMore = ($limit > 0) ? (($count - $offset) > $limit) : false;
            $addCount = array_get_bool($extras, ApiOptions::INCLUDE_COUNT);
            if ($addCount || $needMore || $next) {
                $out['meta']['count'] = $count;
                if ($next) {
                    $out['meta']['next'] = $next;
                }
            }

            return $out;
        } catch (\Exception $ex) {
            throw new InternalServerErrorException("Failed to filter records from '$table'.\n{$ex->getMessage()}");
        }
    }
{@inheritdoc}