Skip to content

sum() column function not working properly #50

@joeolaoye

Description

@joeolaoye

I am trying to get the sum of a column but it's not working properly. it returns an array of rows rather than a single value. My code looks like this:

pendings.find()
    .select(function (column) {
      return column('amount')
        .sum();
    })
    .all()
    .then(function (models) {}):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions