MongoDB is a true data platform with a comprehensive suite of tools to make working with data remarkably easy for everyone, from developers to analysts to data scientists.
MongoDB Cloud is a service connector. It is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.
When using the MongoDB Cloud connector, the first thing you will need to do is go to your Tray.io account page, and select the workflow you wish to work on. Once in the workflow builder itself, search and drag the MongoDB Cloud connector from the connectors panel (on the left hand side) onto your workflow.
With the new MongoDB Cloud connector step highlighted, in the properties panel on the right, click on 'New Authentication' which is located under the 'Settings' heading.
This will result in a Tray.io authentication pop-up window. The first page will ask you to name your authentication, and state which type of authentication you wish to create ('Personal' or 'Organisational').
As you can see, the next page asks you for your 'Username' and 'Password' credentials.
In order to get these fields, head to your MongoDB dashboard. Click on the 'Access Manager' menu and select Project Access.
Here you can create new API keys or find existing keys under the API keys tab.
Once you have added these fields to your Tray.io authentication popup window, click on the 'Create authentication' button. Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.
Your connector authentication setup should now be complete.
The examples below show one or two of the available connector operations in use.
Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.
TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the MongoDB-Cloud connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.
Below is an example of a way in which you could potentially use the MongoDB Cloud connector, to download log data from your account.
The steps will be as follows:
Setup using a manual trigger and download logs
1 - Setup Trigger & download logsCopy
Once you have clicked 'Create new workflow' from your main Tray.io dashboard named it, select the Manual trigger from the trigger options available:
After you have been redirected to the Tray.io workflow dashboard, from the connectors panel on the left, add a MongoDB Cloud connector to your second step. Set the operation to 'Download logs'.
Feel free to re-name your steps as you go along to make things clearer for yourself and other users.
Here you will need to provide the 'Project ID', 'Host name' and 'Log name' to retrive the data from. You also have the option to select a date range to filter the log data. Dates will be sent to the API in UTC timestamp format.
When run, this workflow will download a compressed log data file (.gz) from your MongoDB account and a file object will be available to you.
BEST PRACTICES: Whenever you do decide to create your own workflow, be sure to check out some of our key articles such as: