Carrot reference
Methods
.find()
This method, called on a @Table, returns a Sequence of results matching the filter.
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
db.job.find{startDate >= '2025-01-01'}
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"
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.