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

    Function discoverChatIds

    • Discovers all unique chat IDs from the WhatsApp Evolution PostgreSQL database.

      This function queries the Message table to find all distinct remoteJid values, which represent unique chat conversations. The results are filtered to remove null/empty values and limited to prevent memory issues with large datasets.

      Parameters

      • limit: number = 10000

        Maximum number of chat IDs to return (default: 10000)

      Returns Promise<string[]>

      Promise resolving to an array of chat ID strings

      const chatIds = await discoverChatIds(1000);
      console.log(`Found ${chatIds.length} chats`);
      // Output: Found 500 chats