MongoDB
Last updated
Last updated
The MongoDB tool provides query access to MongoDB using MongoDB's native querying.
Use this tool when you need access to data stored in a MongoDB collection. If all you are doing is performing a simple fetch, you can leverage the Dataset tool that provides a simple abstraction over tabular data. This tool can be used for query constructs that are not supported in the Dataset tool such as nested objects.
A connection to MongoDB should already have been made in the Data Studio. You can set up a connection in the Configurations section for MongoDB.
To create a MongoDB tool, click on Create Tool from the Tools Repository and choose MongoDB
You will get the MongoDB Tool Editor -
As with all tools provide a meaningful name and description that will help the agent understand the purpose of this tool so that the agent can use it correctly.
Storage: Select the MongoDB connection configuration that was created in the Data Studio
Database: Select the MongoDB database you wish to query
Collection: Select the MongoDB collection you wish to query
Filter: This is a template of the BSON query to execute. For details on BSON based MongoDB query please refer to MongoDB documentation. An example : { "_id" : { "oid" : ${orderId} } }
Input Parameters: Any parameters in the filter will show up as input parameters here. The type and description needs to be populated.
Projections: MongoDB supports projections that are quite powerful. Projections allow you to specify what fields you want in the query's output. Refer to the MongoDB documentation for how to specify projections.
Output: Describe the output of the tool for the Agent.
As with all tools, you can test this tool by providing values for the input parameters.