Method: Dynamoid::Document::ClassMethods#count

Defined in:
lib/dynamoid/document.rb

#countInteger

Return the count of items for this class.

It returns approximate value based on DynamoDB statistic. DynamoDB updates it periodically so the value can be no accurate.

It’s a reletively cheap operation and doesn’t read all the items in a table. It makes just one HTTP request to DynamoDB.

Returns:

  • (Integer)

    items count in a table

Since:

  • 0.6.1



82
83
84
# File 'lib/dynamoid/document.rb', line 82

def count
  Dynamoid.adapter.count(table_name)
end