Skip to main content

What's New in MarkLogic 11

Optic Update Generally Available

MarkLogic 11.0 added the “technical preview” of a new capability that allows developers to perform inserts, updates and deletes via the Optic API. This expanded the capability of MarkLogic's unique multi-model query language to make it easier to insert and update documents without having to write server-side code. MarkLogic 11.2 completes this capability with additional operators to support “patching” of subsections of documents and more robust error handling. With this, the Optic Update capability moves out of technical preview and is ready for general use. 

MarkLogic 11.2 introduces the Patch operator and the supporting Patch Builder object. Using these, developers can now easily construct Optic expressions that selectively modify subsections of XML or JSON documents without having to fetch the entire document and without having to write server-side code. For more details, see the section on updating sections of documents in Getting Started with Optic.

MarkLogic 11.2 also introduces the onError operator to support more flexible handling of errors that might occur while updating documents in an Optic pipeline. For more details, see the error handling section in Getting Started with Optic.

See the Building Document Updates documentation for a full overview of all of the Optic Update capabilities.

To fully support the Optic Update Domain Specific Language (DSL), an additional REST endpoint was added in MarkLogic 11.2. The new /v1/rows/update endpoint supports Optic Update DSL and runs all expressions in update transactions. The existing /v1/rows endpoint no longer accepts update expressions and will throw an error that it is not running in an update transaction if updates are attempted. 

The new /v1/rows/update and the existing /v1/rows REST endpoints also now support the “errors” option for “output” parameter. This allows the caller to indicate that they would like only the errors, if any, to be returned, making it easier to identify documents that may need to be reprocessed on a batch-by-batch basis.

Lastly, Query Console now supports the “Optic DSL Update” query type for executing Optic Update expressions directly from Query Console.