Actions11
Overview
This node interacts with MongoDB to perform various operations on collections, including searching, inserting, updating, deleting documents, and managing search indexes. Specifically, the Search Index - List operation retrieves search indexes from a specified MongoDB collection. It can list all search indexes or filter by a specific index name.
Common scenarios for this node include:
- Retrieving metadata about search indexes in a MongoDB collection to understand how data is indexed for search.
- Auditing or monitoring search indexes to ensure they are correctly configured.
- Integrating MongoDB search index information into workflows for automated reporting or maintenance.
Example use case: A user wants to list all search indexes on a "products" collection to verify which fields are indexed for text search before running queries.
Properties
| Name | Meaning |
|---|---|
| Collection | The name of the MongoDB collection on which to operate (e.g., "products", "users"). |
| Index Name | Optional. If provided, only lists search indexes matching this exact name. |
Output
The output is an array of JSON objects, each representing a search index retrieved from the specified collection. Each object contains the full details of a search index as returned by MongoDB's listSearchIndexes() method, including its name and definition.
If the operation filters by index name, only matching indexes are included.
The output structure example:
[
{
"json": {
"name": "mySearchIndex",
"definition": { /* index definition details */ }
},
"pairedItem": [{ "item": 0 }]
},
...
]
No binary data is output by this operation.
Dependencies
- Requires a valid connection to a MongoDB database, authenticated via an API key credential or connection string.
- The node depends on the official MongoDB Node.js driver to interact with the database.
- The MongoDB deployment must support search indexes (MongoDB Atlas Search or equivalent).
- Proper permissions to list search indexes on the target collection are required.
Troubleshooting
Common issues:
- Connection failures due to incorrect credentials or network issues.
- Insufficient permissions to list search indexes on the collection.
- Specifying a non-existent collection or index name results in empty output or errors.
- Malformed input parameters (e.g., invalid collection name).
Error messages:
"Database does not exist": Verify the database name and credentials."Collection not found"or similar: Check that the collection exists."Permission denied": Ensure the connected user has rights to list search indexes.- JSON parsing errors if other operations are used with malformed JSON inputs (not applicable here but relevant for other operations).
To resolve errors, verify credentials, database and collection names, and user permissions. Use the node's "Continue On Fail" option to handle errors gracefully in workflows.