PG→Mongo Ingest CLI - v1.0.0
    Preparing search index...

    Function closeHubMongo

    • Closes the Hub MongoDB connection and cleans up resources.

      This function should be called when the application is shutting down to properly close the MongoDB connection and free up resources. It's safe to call multiple times as it checks if the client exists.

      Returns Promise<void>

      Promise that resolves when the connection is closed

      try {
      // Use the database
      const db = await getHubDb();
      // ... do work
      } finally {
      await closeHubMongo();
      }