我想用带有 id 的行和原始文档中数组的每个值来构建 aa tde。
我为每个元素得到一行,但值为 null 并被忽略。
似乎如果上下文设置为任何不是数组的 ../uri 工作,但当上下文是数组时永远不会。
除了简单的示例之外,我正在努力为 MarkLogic TDE 寻找好的资源,
示例文档(片段)
"instance": {
"uri": "/A/Uri/of/some/type.json",
"types": [
"a",
"b",
"c"
]
}
模板
{
"template":{
"context":"/instance/types",
"collections":["Collection"],
"enabled" : true,
"rows":[
{
"schemaName":"namespace",
"viewName":"uri2types",
"columns":[
{
"name":"uri",
"scalarType":"anyURI",
"val":"../uri",
"nullable":true,
"invalidValues": "ignore"
}
,
{
"name":"type",
"scalarType":"string",
"val":"/node()",
"nullable":true,
"invalidValues": "ignore"
}
]
}
]
}
}
结果
{
"/A/Uri/of/some/type.json": [
{
"row": {
"schema": "namespace",
"view": "uri2types",
"data": {
"rownum": "1"
}
}
},
{
"row": {
"schema": "namespace",
"view": "uri2types",
"data": {
"rownum": "2"
}
}
},
{
"row": {
"schema": "namespace",
"view": "uri2types",
"data": {
"rownum": "3"
}
}
}
]
}
**Result Wanted**
{
"/A/Uri/of/some/type.json": [
{
"row": {
"schema": "namespace",
"view": "uri2types",
"data": {
"rownum": "1",
"uri":"/A/Uri/of/some/type.json":,
"type"="a"
}
}
},
{
"row": {
"schema": "namespace",
"view": "uri2types",
"data": {
"rownum": "2",
"uri":"/A/Uri/of/some/type.json":,
"type":"b"
}
}
},
{
"row": {
"schema": "namespace",
"view": "uri2types",
"data": {
"rownum": "3",
"uri":"/A/Uri/of/some/type.json":,
"type":"c"
}
}
}
]
}