Creating a MongoDB Component

How can you create Database component on LinkApi’s platform? Here, we will detail the step by step to a new MongoDB component.

Click on “Build Component” in the Packages list and start filling the information fields. In this step, the only difference from creating different types of components, is that you should select “Database” on the type field, and MongoDB in the database type. Once that’s done, you can move on to the next step.

The next tab is about Authentication. MongoDB comes by default with “uri” authentication, so for this example, there is nothing to be altered.

The Resources tab follows the same pattern, when you specify which collections (In MongoDB’s case, or which tables for SQL Databases) you need to consume. In our case, we will use an users collection.

For MongoDB, the authentication parameter is the connection string, so if you’re building a component for a different database, check what is theirs.

On the Request tab, you can notice that there are models of requests you can choose. These are the information necessary to consume the resource in question.

For the Response tab, the information can be turned into a table, so you can define which data is unique, and therefore, cannot be repeated.

In the same way when creating a REST component, the database Components also allow you to handle the Code, so you can specify some parameters, filters, or other changes that is convenient for what you need on your received payloads.