Skip to main content

Preflight checks for MongoDB Atlas

Before running the MongoDB Atlas crawler, you can run preflight checks to verify that the connected user has the MongoDB privileges required for metadata extraction. The connector checks the user's privileges via MongoDB's connectionStatus (with showPrivileges); no admin-only APIs are required.

The following preflight checks are performed:

Database and schema check

Validates that the user can list databases and retrieve database statistics.

  • Check successful-User has both listDatabases and dbStats privileges.
  • Check failed-User lacks one or both of listDatabases or dbStats. The failure message lists the missing privileges.

Collections check

Validates that the user can list collections and retrieve collection statistics.

  • Check successful-User has both listCollections and collStats privileges.
  • Check failed-User lacks one or both of listCollections or collStats. The failure message lists the missing privileges.

Overall auth check

Combines the preceding checks into an overall authentication and authorization result.

  • Check successful-User has all four required privileges: listDatabases, dbStats, listCollections, and collStats.
  • Check failed-User is missing one or more of the required privileges. The failure message lists the missing actions.

Requirements for preflight to pass

  • Grant the MongoDB user at least: listDatabases, dbStats, listCollections, and collStats (for example via a custom role or read access on the databases you want to crawl).
  • Use the correct auth source when configuring the connection (for example authSource=admin or the database where the user is defined). The connector reads the auth source from the connection's extra settings.

See also