...

/

Gathering Statistics: Aggregating

Gathering Statistics: Aggregating

Learn about the aggregate function and how to use it in properties.

We'll cover the following...

Aggregate

The aggregate function is similar to the collect function with one simple exception. The aggregate function can take a list of categories to store. Let’s look at the function in action.

Code

Let’s start off with a basic property that uses the aggregate function. It is provided in the code widget below:

defmodule Pbt do
  @moduledoc """
  Documentation for Pbt.
  """

  @doc """
  Hello world.

  ## Examples

      iex> Pbt.hello
      :world

  """
  def hello do
    :world
  end
end
The aggregate function
...