Skip to content

#empty? on ItemCollection always returns false #35

@alanwonglah

Description

@alanwonglah

On a table that has no matches, I ran #empty? and #count expecting to get true and 0, respectively. The following is what I got from rails console.

irb(main):018:0> Resource.scan({filter_expression: "resource_id = ABC"}).empty?
[Aws::DynamoDB::Client 200 0.103658 0 retries] scan(filter_expression:"resource_id = ABC",table_name:"resources_test")

=> false
irb(main):019:0> Resource.scan({filter_expression: "resource_id = ABC"}).count
[Aws::DynamoDB::Client 200 0.067079 0 retries] scan(filter_expression:"resource_id = ABC",table_name:"resources_test")

=> 0

If I'm reading this correctly, the test cases for #empty also expect false (always).

Am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions