Introduction

Mapr db connector allows you to create document structured tables and add structures documents. It is also possible to update the documents and delete using RESTful interface.

MapR-DB is a high performance NoSQL (“Not Only SQL”) database management system built into the MapR Converged Data Platform. It is a highly scalable multi-model database that brings together operations and analytics, and real-time streaming and database workloads to enable a broader set of next-generation data-intensive applications in organizations.

The API supports the following operations: . Create and delete MapR-DB JSON tables . Insert, update, and delete documents from a table . Retrieve documents while specifying filter conditions and projections

Read through this user guide to understand how to set up and configure a basic flow using the connector. Track feature additions, compatibility, limitations and API version updates with each release of the connector using the Connector Release Notes. Review the connector operations and functionality using the Technical Reference alongside the demo application.

MuleSoft maintains this connector under the Enterprise IT support policy.

Prerequisites

This document assumes that you are familiar with Mule, Anypoint Connectors, and Anypoint Studio Essentials. To increase your familiarity with Studio, consider completing a Anypoint Studio Tutorial. This page requires some basic knowledge of Mule Concepts, Elements in a Mule Flow, and Global Elements.

Software Requirements

  1. Anypoint Studio with Mule Runtime 3.8.x

  2. Mapr cluster 6.0.x or higher

Compatibility

MapR DB connector supports Mule 3.8.x version.

Installing the Connector

You can install the connector in Anypoint Studio using the instructions in Installing a Connector from Anypoint Exchange.

Installation guide is also available here

Upgrading from an Older Version

Since this is the first version of MapR DB Connector, upgrading from older version is not applicable.

Configuring the Connector Global Element

To use the Anypoint MapR DB connector in your Mule application, you must configure a global element that can be used by the Anypoint mapr db connector (read more about Global Elements). The MapR DB connector offers the following global configuration(s), requiring the following credentials: Username, password, api url and SSL Configuration.

Field Description

Username

Enter the Username to access MapR Data access Gateway.

Password

Enter the Password to access MapR Data access Gateway.

API Url

Enter the MapR DB JSON REST API URL.

TruststoreFilePath

Enter the path of ssl_truststore file (optional)

TruststorePassword

Enter the password of the trustore file (optional)

KeystoreFilePath

Enter the path of ssl_keystore file (optional)

KeystorePassword

Enter the password of the keystore file (optiona)

Insecure

Check this checkbox if you want to establish an insecure SSL connection with MapR

Using the Connector

The below list of operations can be performed by using MapR Connector.

Operation

Description

inbound

Outbound

Create a table

Creates a MapR-DB JSON table.

Path and Table Name

Boolean true indicating table created successfully.

Add documents

Adds one or more documents to a MapR-DB JSON table.

Path, Table Name, mode, fieldAsKey, Structured Document as Payload

Boolean true indicating documents added successfully.

Update document by id

Updates a document by id in a MapR-DB JSON table.

Path, Table Name, id, condition and document as payload

Boolean true indicating document is updated successfully.

Update partial document by id

Updates a partial document by id in a MapR-DB JSON table using mutations

Path, Table Name, id, mode, condition and document as payload

Boolean true indicating partial document updated successfully.

Retrieve document by id

Retrieves a single document by id from a MapR-DB JSON table

Path, Table Name, id, fields, withTags, condition

The document with the id specifed.

Retrieve documents

Retrieves one or more documents from a MapR-DB JSON table

Path, Table Name, fields, withTags, condition, fromId, told, offset, limit, getPlan, orderBy, query

Gets list of all document in the table.

Delete document by id

Removes user from workspace.

Path, Table Name, id and condition

Boolean true indicating document corresponding to the given id is deleted successfully.

Delete a table

Drops a MapR-DB JSON table

Path and Table Name

Boolean true indicating table is deleted successfully.

Connector Namespace and Schema

When designing your application in Studio, the act of dragging the connector from the palette onto the Anypoint Studio canvas should automatically populate the XML code with the connector namespace and schema location.

 *Namespace:* `http://www.mulesoft.org/schema/mule/mapr-db`
*Schema Location:* `http://www.mulesoft.org/schema/mule/mapr-db/current/mule-mapr-db.xsd`
Tip
If you are manually coding the Mule application in Studio’s XML editor or other text editor, define the namespace and schema location in the header of your Configuration XML, inside the <mule> tag.
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:mapr-db="http://www.mulesoft.org/schema/mule/mapr-db" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:spring="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/mapr-db http://www.mulesoft.org/schema/mule/mapr-db/current/mule-mapr-db.xsd">
    <flow name="mapr-db-demoFlow">
        <mapr-db:no-operation-selected config-ref="" doc:name="mapr-db"/>
    </flow>
</mule>

Using the Connector in a Mavenized Mule App

If you are coding a Mavenized Mule application, this XML snippet must be included in your pom.xml file.

    <dependency>
	<groupId>org.mule.modules</groupId>
	<artifactId>mapr-db-connector</artifactId>
        <version>1.0.0</version>
    </dependency>

Demo Mule Applications Using Connector

Connector demo application is available here

Example Use Case

MapRDBDemo application contains all the example use cases like CRUD operations for Tables and Documents etc.

Resources