Search code examples
marklogic-9mlcpmarklogic-dhf

MarkLogic - mlcp export of JSON documents


MarkLogic version : 9.0-6.2 MLCP - version - 9.0.6

I am trying to export a collection (customer) of JSON documents with mlcp export, using below code. I am not getting any response from mlcp after I execute the script, and the output file is not created.

mlcp.sh export -ssl \
-host localhost \
-port 8010 \
-username uname \
-password pword \
-mode local \
-out_file_path /test/TestFiles/customer.txt \
-collection_filter customer \
-output_type document

I verified that data-hub-STAGING (8010 port) has a collection named customer with 100 JSON documents. The linux user has execute permissions on the script and write permissions on the output path. The user and password are correct.

Interestingly, when I run below mlcp code from the same directory, with the same linux user, I am able to import the documents into data-hub-STAGING

mlcp.sh import -ssl \
-host localhost \
-port 8010 \
-username uname \
-password pword \
-mode local \
-input_file_path /test/TestFiles/Customer \
-input_file_type documents \
-output_collections customer \
-output_uri_prefix /customer/ \
-output_uri_suffix ".json"

Anything wrong with my export code?


Solution

  • Looks like you have a typo: it is -output_file_path, not -out_file_path. Also, the value that follows that parameter is treated as a directory name, and should not exist yet.

    HTH!