ItemOutputBuilder
Refines an Item result into a single Item, an array, a cursor or a page.
Remarks
Section titled “Remarks”cursor() and page() take precedence over array() and are always mandatory.
Methods
Section titled “Methods”array()
Section titled “array()”array(
value?):this
Declares the result as an array of Items.
Parameters
Section titled “Parameters”value?
Section titled “value?”boolean
Whether the result is an array.
Returns
Section titled “Returns”this
This builder for chaining.
Default Value
Section titled “Default Value”truecursor()
Section titled “cursor()”cursor():
this
Declares the result as a cursor over Items, for handlers that return a selector’s execute().
Returns
Section titled “Returns”this
This builder for chaining.
mandatory()
Section titled “mandatory()”mandatory(
value?):this
Marks the Item as always present.
Parameters
Section titled “Parameters”value?
Section titled “value?”boolean
Whether the Item is required.
Returns
Section titled “Returns”this
This builder for chaining.
Default Value
Section titled “Default Value”truepage()
Section titled “page()”page():
this
Declares the result as a page of Items with pagination metadata.
Returns
Section titled “Returns”this
This builder for chaining.
toDefinition()
Section titled “toDefinition()”toDefinition():
ArrayOutputDefinition|CursorOutputDefinition|ItemOutputDefinition|PageOutputDefinition
Emits the Item output Definition in the shape selected by array, cursor or page.
Returns
Section titled “Returns”ArrayOutputDefinition | CursorOutputDefinition | ItemOutputDefinition | PageOutputDefinition

