Reputation: 21
I have a rest instance created on 8002 port and it is using default details database etc. I have another database and I want to see all documents available there and also I want to get specific document.
http://localhost:8002/LATEST/rest-apis/ - work fine and show database, port etc details but when I add /search?database=nuxeo I got error 400
How can I achieve this
TIA
Upvotes: 0
Views: 48
Reputation: 7770
The instance on port 8002 is part of management API..
For MarkLogic 8 and beyond, the idea of needing your own rest API is not needed (the HTTP rewriter takes care of this) and you can pass a parameter to set the database.
For your need above, I would be hitting the search endpoint as described here with examples: https://docs.marklogic.com/REST/GET/v1/search
Example:
http://localhost:8000/v1/search?database=nuxeo&q=*
You can then tune these results to give you just the URIS(other interesting endpoints are available as well such as the values endpoint) or transform the data in other ways.
For getting a single document, then you would use the document get endpoint (look in the same REST API docs for that one)
Upvotes: 4