Objects are Now Exported Deeply in Optic
- Last Updated: April 14, 2026
- 1 minute read
- MarkLogic Server
- Version 11.0
- Documentation
In versions prior to MarkLogic 11, a key-value object was exported as itself. In MarkLogic 11, the keys and values will be examined and exported one by one. Nested objects will be exported as well.
For example, this query
op.fromLexicons({
uri:cts.uriReference(),
number:cts.jsonPropertyReference('srchNumber'),
city:cts.jsonPropertyReference('srchCity')
},
'docRange')
.export();
would have been exported like this in versions prior to MarkLogic 11:
{$optic:{ns:'op', fn:'operators', args:[
{ns:'op', fn:'from-lexicons', args:[{
uri: {uriReference:{}},
number: {jsonPropertyReference:{property:'srchNumber', scalarType:'int', nullable:false}},
city: {jsonPropertyReference:{property:'srchCity', scalarType:'string', nullable:false,
collation:'http://marklogic.com/collation/'}}
},
'docRange']}
]}};
In MarkLogic 11, it is exported like this:
{$optic:{ns:'op', fn:'operators', args:[
{ns:'op', fn:'from-lexicons', args:[{
uri: {ns: 'cts', fn: 'uri-reference', args: []},
number: {ns: "cts",
fn: "json-property-reference",
args: ["srchNumber", ["type=int"]]
},
city: {ns: "cts",
fn: "json-property-reference",
args: ["srchCity",
["type=string", "collation=http://marklogic.com/collation/"]
]
}
},
'docRange']}
]}};