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

    Function getHubClient

    • Gets or creates a MongoDB client connection to the Hub database.

      This function implements a singleton pattern to ensure only one client connection is maintained throughout the application lifecycle. The connection is lazily initialized on first use.

      Returns Promise<MongoClient>

      Promise resolving to the MongoDB client instance

      const client = await getHubClient();
      const db = client.db('data');
      const collection = db.collection('message');