Member-only story
Enable connectivity and perform CRUD operations in MarkLogic Server using JAVA
MarkLogic is a database designed from the ground to create massive quantities of heterogenous data that can be easily accessed via a simple search operation.
The purpose of this article is to cover how connections can be made with MarkLogic and perform Insert, Delete, and read documents using JAVA.
Refer to the below sample code to enable connectivity and also perform read, view, and delete operations.
1. Create Database:
Before you can use the REST Client API, you must have access to an instance that consists of an HTTP App Server specially configured to handle REST Client API requests, a content database, and a modules database.
By using the below CURL you can create a database rest instance that can access through HTTP.
Access the Database by Its name and Port that we mention while creating.
Here we can access the DB through 8060 PORT
curl --digest --user admin:adminpassword -X POST http://localhost:8002/v1/rest-apis \
-H 'Content-Type: application/json' \
-d '{
"rest-api" :{
"name": "8060-markdb",
"database": "markdb",
"port": "8060",
"forest-per-host": "1"
}
}'