You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To list all Atlas Search indexes using Python, you can use the Atlas Search API or the Atlas UI. Here are the steps to list all Atlas Search indexes using the Atlas Search API:
First, you need to create an API key with the appropriate permissions to access the Atlas Search API. You can do this by following the instructions in the Atlas documentation.
Once you have created an API key, you can use it to authenticate your requests to the Atlas Search API. You can find more information on how to authenticate your requests in the Atlas documentation.
To list all Atlas Search indexes, you can use the GET /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/ftsIndexes endpoint of the Atlas Search API. You will need to replace {GROUP-ID} with your Atlas group ID and {CLUSTER-NAME} with the name of your Atlas cluster. You can find more information on how to use this endpoint in the Atlas documentation.
I would probably consider this as a 'nice to have'. Unfortunately I cannot list Atlas search indexes from the MongoDB Python driver.
A very obscure exception occurs if the Atlas Search index doesn't exist.
OperationFailure: PlanExecutor error during aggregation :: caused by :: Error connecting to localhost:28000 (127.0.0.1:28000) :: caused by :: Connection refused, full error: {'ok': 0.0, 'errmsg': 'PlanExecutor error during aggregation :: caused by :: Error connecting to localhost:28000 (127.0.0.1:28000) :: caused by :: Connection refused', 'code': 6, 'codeName': 'HostUnreachable', '$clusterTime': {'clusterTime': Timestamp(1701962312, 7), 'signature': {'hash': b'\xb7Fx\xee\x01L\xa4%\xbb\r\x8d\x9f\x04\x8b\xbcW\x07\xa9\x8f\xee', 'keyId': 7306191798055993350}}, 'operationTime': Timestamp(1701962312, 7)}
Either validate it exists OR catch the exception and provide a clearer response.
The text was updated successfully, but these errors were encountered: