Loading TOC...

MarkLogic 12 Product Documentation
op:desc

op:desc(
   $column as item()
) as map:map

Summary

This function sorts the rows by the values of the specified column in descending order. The results are used by the op:order-by function.

Parameters
$column The column to order the output. The column can be named with a string or a column function such as op:col, op:view-col, or op:schema-col, or constructed from an expression with the op:as function.

Example

xquery version "1.0-ml";

import module namespace op="http://marklogic.com/optic"
     at "/MarkLogic/optic.xqy";

op:from-view("main","employees")
=> op:order-by(op:desc("Salary"))
=> op:result()
  

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