Marklogic:在导入 csv 时在文档上创建了多个 XML 文件。如何获取根文档 URI 路径?
Marklogic : Multiple XML files created on document on importing a csv. How to get root Document URI path?
我是 Marklogic 的新手,我尝试将我的 100k 记录的 CSV 文件导入 Marklogic,导入后,我发现它默认导入到文档数据库。此外,我发现对于每条记录,我看到数据库中生成了一个 XML 文件,并在导入时提到的 "documentUri" 后附加了增量编号。例如:documentUri_1.xml。我了解创建多个 xml 文件是为了以分布式方式读取数据。
Question:
1. How to get the root document URI for this document? which has multiple xml files?
Question: 2. How do i import the same CSV file to a different database?
Question: 3. When I use xquery to list all documents in the database, I am getting all the all xml files URI rather just the dummy.xml uri? How do I achieve this?
注意:我使用以下命令导入:
mlcp.bat import -host localhost -port 8000 -username admin -password admin -input_file_path dummy.csv -mode local -input_file_type delimited_text -uri_id 'dummy.xml'
你能帮我解决这个问题吗?
问题 1) 没有 "root document" 这样的东西。每个文件都独立存在。但您可以按集合将文档分组(见下文)。
问题 2) 使用 -database mlcp 选项。
问题 3) 我认为您正在寻找 mlcp 选项 -filename_as_collection。这将允许您通过以文件命名的集合来查找文档。例如,在 XQuery 中:
collection("dummy.csv")
答案无效,因为您的示例不包含推荐的命令选项
-filename_as_collection
无法在以下位置找到:
mlcp.bat import -host localhost -port 8000 -username admin -password admin -input_file_path dummy.csv -mode local -input_file_type delimited_text -uri_id 'dummy.xml'
我是 Marklogic 的新手,我尝试将我的 100k 记录的 CSV 文件导入 Marklogic,导入后,我发现它默认导入到文档数据库。此外,我发现对于每条记录,我看到数据库中生成了一个 XML 文件,并在导入时提到的 "documentUri" 后附加了增量编号。例如:documentUri_1.xml。我了解创建多个 xml 文件是为了以分布式方式读取数据。
Question: 1. How to get the root document URI for this document? which has multiple xml files? Question: 2. How do i import the same CSV file to a different database?
Question: 3. When I use xquery to list all documents in the database, I am getting all the all xml files URI rather just the dummy.xml uri? How do I achieve this?
注意:我使用以下命令导入:
mlcp.bat import -host localhost -port 8000 -username admin -password admin -input_file_path dummy.csv -mode local -input_file_type delimited_text -uri_id 'dummy.xml'
你能帮我解决这个问题吗?
问题 1) 没有 "root document" 这样的东西。每个文件都独立存在。但您可以按集合将文档分组(见下文)。
问题 2) 使用 -database mlcp 选项。
问题 3) 我认为您正在寻找 mlcp 选项 -filename_as_collection。这将允许您通过以文件命名的集合来查找文档。例如,在 XQuery 中:
collection("dummy.csv")
答案无效,因为您的示例不包含推荐的命令选项
-filename_as_collection
无法在以下位置找到:
mlcp.bat import -host localhost -port 8000 -username admin -password admin -input_file_path dummy.csv -mode local -input_file_type delimited_text -uri_id 'dummy.xml'