ash v1.24.1 Ash.Resource.Dsl.Count View Source

Link to this section Summary


Declares a named aggregate on the resource

Link to this section Functions

Link to this macro

count(name, relationship_path, opts \\ [])

View Source (macro)

Declares a named aggregate on the resource


count :assigned_ticket_count, :reported_tickets, filter: [active: true]


  • :name - The field to place the aggregate in

  • :relationship_path - The relationship or relationship path to use for the aggregate


  • :kind - Required. The kind of the aggregate

  • :filter - A filter to apply to the aggregate The default value is [].

  • :description - An optional description for the aggregate

  • :private? - Whether or not the aggregate will appear in any interfaces created off of this resource, e.g AshJsonApi and AshGraphql The default value is false.