Reputation: 1432
I am trying to insert multiple documents into the MarkLogic
database using Rest-API
. I wanted to customize the uri
while inserting by specifying particular attribute as uri. Here is the json file:
{
"id" : "101",
"firstName" : "I",
"middle name" : "Love",
"last name : "Myself",
"emailId" : "[email protected]"
}
If I wanted to specify emailId attribute of json
mentioned above as uri
while inserting the record.
Can anybody let me now, How to achieve it?
Upvotes: 3
Views: 137
Reputation: 11771
Once you've initialized a REST API server instance, you specify document URI using the PUT command:
$ curl --anyauth --user user:password -X PUT -d@'./one.xml' \ -H "Content-type: application/xml" \ 'http://localhost:8000/LATEST/documents?uri=/xml/one.xml'
Upvotes: 2