Loading TOC...

MarkLogic 12 EA 1 Product Documentation
op:where-distinct

op:where-distinct(
   $plan as map:map
) as map:map

Summary

This method removes duplicate rows from the row set.

Parameters
$plan The Optic Plan. You can either use the XQuery => chaining operator or specify the variable that captures the return value from the previous operation.

Example

xquery version "1.0-ml";

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

op:from-literals((
	              map:entry("id", 1) => map:with("val", 2),
	              map:entry("id", 1) => map:with("val", 2),
	              map:entry("id", 2) => map:with("val", 4)
	              ))
	            => op:select(())
	            => op:where-distinct()
	            => op:result()
  

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