The MongoDB component is a data component that allows users to access the MongoDB NoSQL database.
It can carry out the following tasks:
#Release Stage
Alpha
#Configuration
The component definition and tasks are defined in the definition.yaml and tasks.yaml files respectively.
#Setup
In order to communicate with MongoDB, the following connection details need to be
provided. You may specify them directly in a pipeline recipe as key-value pairs
within the component's setup
block, or you can create a Connection from
the Integration Settings
page and reference the whole setup
as setup: ${connection.<my-connection-id>}
.
Field | Field ID | Type | Note |
---|
URI (required) | uri | string | Fill in your MongoDB URI. |
#Supported Tasks
#Insert
Perform an insert operation
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_INSERT |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
ID | id | string | The ID of the document. |
Data (required) | data | object | The data to be inserted. |
Output | Field ID | Type | Description |
---|
Status | status | string | Insert status. |
#Insert Many
Perform an insert many operation
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_INSERT_MANY |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
Array ID | array-id | array[string] | The array of id. |
Data (required) | array-data | array[object] | The array data to be inserted. |
Output | Field ID | Type | Description |
---|
Status | status | string | Insert many status. |
#Find
Perform a find operation
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_FIND |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
ID | id | string | The ID of the document. |
Filter | filter | object | The filter to find documents, please refer to the documentations. If empty then all documents will be returned. |
Limit | limit | integer | The number of documents to return. If empty then all documents will be returned. |
Fields | fields | array[string] | The fields to return in the documents. If empty then all fields will be returned. |
Output | Field ID | Type | Description |
---|
Result | result | object | Result of the find operation. |
Status | status | string | Find status. |
Output Objects in Find
Result
Field | Field ID | Type | Note |
---|
Metadata | data | array | The data returned from the find operation. |
Documents | documents | array | The documents returned from the find operation. |
IDs | ids | array | The ids returned from the find operation. |
#Update
Perform an update operation
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_UPDATE |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
ID | id | string | The ID of the document. |
Filter | filter | object | The filter to update documents, please refer to the documentations. If empty then all documents will be returned. |
Update (required) | update-data | object | The updated data to be applied to the documents. |
Output | Field ID | Type | Description |
---|
Status | status | string | Update status. |
#Delete
Perform a delete operation
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DELETE |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
ID | id | string | The ID of the document. |
Filter | filter | object | The filter to delete documents, please refer to the documentations. If empty then all documents will be returned. |
Output | Field ID | Type | Description |
---|
Status | status | string | Delete status. |
#Drop Collection
Delete the collection
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DROP_COLLECTION |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
Output | Field ID | Type | Description |
---|
Status | status | string | Delete collection status. |
#Drop Database
Delete the database
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DROP_DATABASE |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Output | Field ID | Type | Description |
---|
Status | status | string | Delete database status. |
#Create Search Index
Create a search index, only works for M10 or larger clusters
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_CREATE_SEARCH_INDEX |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
Index Name (required) | index-name | string | The name of the index to be created. |
Index Type (required) | index-type | string | The type of the index to be created.
Enum values |
Syntax (required) | syntax | object | The syntax structure of the search index, please refer to the MongoDB documentation for more information. search here. vectorSearch here. |
Output | Field ID | Type | Description |
---|
Status | status | string | Create index status. |
#Drop Search Index
Drop a search index, only works for M10 or larger clusters
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DROP_SEARCH_INDEX |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
Index Name (required) | index-name | string | The name of the index to be dropped. |
Output | Field ID | Type | Description |
---|
Status | status | string | Delete index status. |
#Vector Search
Perform a vector search operation
Input | Field ID | Type | Description |
---|
Task ID (required) | task | string | TASK_VECTOR_SEARCH |
Database Name (required) | database-name | string | The name of the database in MongoDB. |
Collection Name (required) | collection-name | string | The name of the collection in MongoDB. |
Index Name (required) | index-name | string | The name of the index to be used for vector search. |
Query Vector (required) | query-vector | array[number] | The query vector to be used for vector search. |
Exact | exact | boolean | The exact value for vector search. If true, then ENN search will be performed, otherwise ANN search will be performed. Default to false. |
Limit (required) | limit | integer | Limit the documents to be returned. |
Number of Candidates | num-candidates | integer | The number of candidates to the field to be used for vector search. Default to 3 times limit. |
Path (required) | path | string | The path to the field to be used for vector search. |
Filter | filter | object | The filter to be used for vector search, need to first create filter vectorSearch search index, please refer to the documentations. If empty then all documents will be returned to be used for vector search. |
Fields | fields | array[string] | The fields to return in the documents. If empty then all fields will be returned. |
Output | Field ID | Type | Description |
---|
Result | result | object | Result of the vector search operation. |
Status | status | string | Vector search status. |
Output Objects in Vector Search
Result
Field | Field ID | Type | Note |
---|
Documents | documents | array | The documents returned from the vector search operation. |
IDs | ids | array | The ids returned from the vector search operation. |
Metadata | metadata | array | The metadata returned from the vector search operation. |
Vectors | vectors | array | The vectors returned from the vector search operation. |