Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MarkLogic:列出目录中的所有JSON,并使用元数据转换为另一种JSON格式_Json_Marklogic - Fatal编程技术网

MarkLogic:列出目录中的所有JSON,并使用元数据转换为另一种JSON格式

MarkLogic:列出目录中的所有JSON,并使用元数据转换为另一种JSON格式,json,marklogic,Json,Marklogic,目录/report types中有许多相同格式的JSON文件。它们看起来像FITP.json: { "reportTypeId": "FITP", "reportName": { "translations": { "*": "Fixed Income Two Pager" } }, "reportParameters": [], "outputFormats": [ {

目录
/report types
中有许多相同格式的JSON文件。它们看起来像
FITP.json

{
    "reportTypeId": "FITP",
    "reportName": {
        "translations": {
            "*": "Fixed Income Two Pager"
        }
    },
    "reportParameters": [],
    "outputFormats": [
        {
            "format": "word",
            "styleSheet": "word_FITP.docx"
        }
    ],
    "body": {
        // comments not allowed in JSON, but here comes so much irrelevant stuff
    }
}
我想创建一个MarkLogic REST查询(最好是
POST
),该查询

  • 浏览目录
    /report types
  • 在上面的示例中将它们转换为以下JSON:
  • 在响应中将这些结果JSON作为数组返回
  • 此任务应使用哪个查询端点

    • ../LATEST/qbe?目录=/报告类型
    • ../LATEST/search?directory=/report types
    • 还是别的什么
    转换查询(体现在
    POST
    请求中)是什么样子的,它为我提供了所需的结果

    {
        "reportTypeId": "FITP",
        "reportName": "Fixed Income Two Pager",
        "outputFormats: [ "word" ],
        "createdAt": "", // again invalid comment, but insert time stamp of creation here (file metadata?)
        "modifiedAt": "", // same here, for modification date
    }