Reputation: 1
I am just starting to work with Marklogic and I am running simple commands like xdmp.document.load to ingest a json file
declareUpdate();
xdmp.documentLoad("C:\Users\Documents\SemanticData\Recipies\Tofu-Soup.json",
{
"uri" : "/documents/tofu-soup.json",
"permissions" : xdmp.defaultPermissions(),
"collections" : ["soup", "vegetarian"],
"encoding" : 'UTF-8'
})
I receive the following error where the path name has had all the "\" directory separators removed.
[javascript] SVC-FILOPN: xdmp.documentLoad("C:UsersDocumentsSemanticDataRecipiesTofu-Soup.json", {uri:"/documents/tofu-soup.json", permissions:[], collections:["soup", "vegetarian"], ...}) -- File open error: open 'C:UsersDocumentsSemanticDataRecipiesTofu-Soup.json': No such file or directory
I cannot find anything in the functions guide to illuminate me.
Any ideas
Upvotes: 0
Views: 135
Reputation: 321
You can run command in following way.
declareUpdate();
xdmp.documentLoad("C:\\Users\\Documents\\SemanticData\\Recipies\\Tofu-Soup.json",
{
"uri" : "/documents/tofu-soup.json",
"permissions" : xdmp.defaultPermissions(),
"collections" : ["soup", "vegetarian"],
"encoding" : 'UTF-8'
})
Upvotes: 1
Reputation: 20414
Use forward slash, or escape the backslash by doubling it. Backslash is an escape character in JavaScript strings.
HTH!
Upvotes: 2