
op.desc( columndef as ColumnIdentifier ) as sortdef
This function sorts the rows by the values of the specified column in descending order. The results are used by the prototype.orderBy function.
| Parameters | |
|---|---|
| columndef | The column to order the output. The column can be named with a string or a column function such as op.col, op.viewCol, or op.schemaCol, or constructed from an expression with the op.as function. |
const op = require('/MarkLogic/optic');
op.fromView("main","employees")
.orderBy(op.desc("Salary"))
.result()
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.