MarkLogic brings all the features you need into one unified system as it is the only Enterprise NoSQL database. MarkLogic can bring multiple heterogeneous data sources into a single platform architecture, allowing for homogenous data access. For bringing the data we need to insert the documents. On the query console, we are able to perform the query according to requirements.
Bringing in the documents
There are many ways to insert documents into a MarkLogic database. Available interfaces include:
- MarkLogic Data Hub
- MarkLogic Content Pump
- Apache Nifi
- REST API
- XQuery functions
- Data Movement SDK (Java API)
- Node.js API
- Apache Kafka
- Content Processing Framework
Explanation of available interfaces
- MarkLogic Data Hub: The MarkLogic Data Hub is open-source software that is used to inject data from different sources or from multiple sources. It is used to import the data as well as harmonize the data.
- MarkLogic Content Pump: It is a command line tool for bulk loading billions of documents into a MarkLogic database, extracting or copying the content. It helps us to make workflow integration very easy.
- Apache Nifi: It is useful when someone needs to ingest data from a relational database into a MarkLogic Database.
- REST API: It provides a programming language agnostic way to write a document in MarkLogic.
- XQuery functions: When we want to write the document to a MarkLogic database then this function is used. Able to write the records from the query console or from the XQuery application.
- MuleSoft: The Marklogic connector for MuleSoft is Used to bring data from various other systems into the MarkLogic database.
- Data Movement SDK (Java API): Included in the java API, the data movement SDK provides the classes for java developers to use to import and transform documents.
- Node.js API: It provides Node.js classes for the developers to use to write the document to a MarkLogic database from their Node.js code.
- Apache Kafka: When we need to stream the data into the database, we can do it by using the Kafka MarkLogic connector.
- Content Processing Framework: A Pipeline framework for making changes to documents as they are being loaded into the database, such as enriching the data or transforming the PDF or MS office document in XML.
- XML Contentbase Connector (XCC): If you need to create a multi-tier application that communicates with the MarkLogic then it is useful.
- WebDAV: Web Distributed Authoring and Versioning used to drag and drop the documents in the Marklogic Database.
Inserting the document using the Query Console
xdmp.documentLoad() function. Used to load the document from the file system into a database.
xdmp.documentLoad("path of the source file")
The xdmp.documentinsert() function is used to write a document into a database.
'title : 'Knoldus' ,
'description': 'Amazing place to work'
Uniform Resource Identifier (URI)
To address any document in a MarkLogic database, it is necessary that each document has a unique URI.
The URI does not refer to the physical location of a document in a database. Provides a unique name for referencing the document.
Deleting the documents
- The clear button in the admin interface can be used to delete all the documents in a database.
- To delete an individual document, the xdmp.documentDelete() function can be used.
Accessing a Document
To read a document in a database, use the cts.doc().
MarkLogic is a NoSql database with many facilities and if someone wants to insert the data then this blog is helpful. After insertion needs to access and modify the document by using some predefined functions.