MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling.
With Kony Fabric MongoDB database adapter, you can connect to your own MongoDB database as an endpoint. For example, you can use MongoDB data adapter to implement a data store that provides high performance, high availability, and automatic scaling such as e-commerce product catalog, blogs and content management, and mobile and social networking sites.
After you configure the MongoDB document database adapter in Kony Fabric Console, you can create, read, update and delete (CRUD operations) on MongoDB collections and documents.
Perform the following steps to configure the MongoDB database adapter with Kony Fabric:
To configure the MongoDB Adapter in the Integration service definition tab, follow these steps:
mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]].
Element | Description |
---|---|
mongodb:// | This is a mandatory prefix required to identify that this string is in standard connection format. Use a connection string prefix of mongodb+srv: rather than the standard mongodb: to leverage the DNS seedlist. The +srv is added as an indicator to the client that the hostname that follows it corresponds to a DNS SRV record. The driver or mongo shell will query the DNS for the record to determine the hosts that are running the MongoDB instances. |
username:password@ | This field is optional. Use this to add authentication to access the MongoDB database. |
host[:port] | Hostname, and port number. The port number is optional |
/database | Name of the database. This is optional. |
?<options> | String that specifies the connection specific options as <name>=<value> pairs. |
Parameter | Description |
---|---|
Hostname | Database connection URL. |
Port | The port number of the MongoDb server to which you want to connect. |
Database Name | Name of the database name. |
User Name | User ID for the connection URL |
Password | User Password |
Connections per host | Maximum number of connections allowed per host. |
Maximum Wait time | Number in milliseconds that a thread may wait for a connection to become available. |
Connection Timeout | Number of milliseconds the driver will wait before a new connection attempt is aborted. |
Socket Timeout | Number of milliseconds a send or receive on a socket can take before timeout. |
If the entered details are correct, the system displays the message: Valid Database connection details.
Important: If your database is configured with a proxy server, you must select an environment and then click Test Connection to test the database connectivity. The environment should be => V8.3
.
For example, you have the Kony Fabric Console installed on one machine, and the Runtime and Database servers installed on another machine. When you create an integration service of type MongoDB Database, the Console must be established with a VPN connection to the MongoDB Database server. So that, when you test the Database connection, the test case will be successful. You can do this by selecting the correct environment for your Runtime Server which will ensure a VPN connection between the Console and the Runtime Server and test the database. If the entered details are correct, the system displays the message: Valid Database connection details.
Note: The Authentication section is optional.
Field | Description |
---|---|
Custom Code | To specify a JAR associated to the service, select one from the Select Existing JAR drop-down menu or click Upload New to add a new JAR file. Make sure that you upload a custom JAR file that is built on the same JDK version used for installing Kony Fabric Integration. |
API Throttling |
|
Note: The Advanced section is optional.
The Operations List tab appears only after you save the service definition. Alternatively, you can also click Add > Add New Operation to create or configure operations.
To create an operation, follow these steps:
<MongoCollection/MongoDocument>_<operation_name> and these names are auto-generated.
MongoCollection_create
and MongoDocument_create
.After you create operations, they are configured with request and response parameters by default.
The following table details pre-configured parameters for request and response operations :
MongoDB Operations | Request Parameters | Response Parameters |
---|---|---|
MongoCollection_Create |
|
|
MongoCollection_Read |
NA |
|
MongoCollection_Delete |
NA |
NA |
MongoDocument_Create |
|
|
MongoDocument_Update |
|
|
MongoDocument_Get |
|
|
MongoDocument_Delete |
|
NA |
MongoDB stores BSON documents, for example, data records in collections; the collections in databases.
Refer the following table for key terminology.
Terminology | Concept |
---|---|
Database | In MongoDB, a database holds collections of documents. |
Collection | A collection is analogous to a table of an RDBMS. A collection may store any number of documents. |
Document/Object |
A document in MongoDB is analogous to a record in RDBMS and it is a data structure composed of field and value pairs have the following structure: { field1: value1, field2: value2, ... fieldN: valueN } MongoDB documents are similar to JSON objects. The values of fields may include other documents, arrays, and arrays of documents. |
Field | A name-value pair in a document. A document has zero or more fields. Fields are analogous to columns in relational databases. |
Following are the advantages of using MongoDB Adapter:
$filter, $top,
and $skip
.Following are the limitations to use the Kony Fabric MongoDB Adapter:
Any CRUD operation which involves bulk activity using multiple Document IDs cannot be performed through this adapter.
Copyright © 2020 Kony, Inc. All rights reserved. |