Loading TOC...

MarkLogic 12 Product Documentation
op.desc

op.desc(
   columndef as ColumnIdentifier
) as sortdef

Summary

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.

Example


const op = require('/MarkLogic/optic');

op.fromView("main","employees")
  .orderBy(op.desc("Salary"))
  .result()

  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.