I want to find max value from a table:
knexClient
.queryBuilder()
.withSchema('myschema')
.from('mytable')
.where({some_query})
.max('value');
It returns the needed value as an array with a single element: [{max: 1000}]
Why does it return an array, not just a number, or an object?
knexClient
.queryBuilder()
.withSchema('myschema')
.from('mytable')
.where({some_query})
.max('value')
.first(); // Add this to get an object