loadMin method
Lazily loads the minimum value of a column in a relation.
Stores the min result as an attribute with the suffix _min_{column}.
Example:
await post.loadMin('comments', 'created_at');
final earliestComment = post.getAttribute('comments_min_created_at');
Implementation
Future<TModel> loadMin(
String relation,
String column, {
String? alias,
PredicateCallback<OrmEntity>? constraint,
}) async {
return _loadAggregate(
RelationAggregateType.min,
relation,
column,
alias: alias,
constraint: constraint,
);
}