Carrot reference
Methods

.find()

Description

This method, called on a @Table, returns a Sequence of results matching the filter.

Syntax

db.table.find()

  • Returns a Sequence of all of the objects in the Table.

db.table.find{expression}

  • Returns a Sequence of all of the objects in the Table that match expression

Examples

db.job.find{startDate >= '2025-01-01'}

  • Returns a Sequence of all Jobs with a start-date from Jan 1 2025 and on.

db.opportunity.find{type:new stage:"closed won"}

  • Returns a Sequence of all Opportunity objects (if you have an opportunity Table), which are of Type "new" and Stage "Closed Won"

Find and Aggregations in Dashboards

Often, find() is combined with other methods to calculate aggregations in Dashboards. For example:

  • db.job.find{startDate >= '2025-01-01}.mean{baseComp}
    • Calculates the mean average base compensation for all jobs that started from 2025-01-01 on.
  • db.job.find{jobFilter}.groupBy{department}.sum{cost}
    • Calculates the total cost of jobs matching the jobFilter filter, grouped by each department.