Iulian
12/31/2025, 2:41 PMkapa.ai
12/31/2025, 2:41 PM51091 or “pattern string is longer than the limit set by the application,” so I can’t give a definitive, Airbyte‑specific root cause or fix. What we do know from the docs and forum threads is: - The MongoDB v2 connector relies heavily on MongoDB aggregation (e.g., $project, sampling, schema discovery) and can hit MongoDB‑side limitations or validation errors when queries or expressions are not accepted by the server. [[MongoDB v2 troubleshooting](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations)] - There are known issues where certain characters or patterns in field names or expressions cause MongoDB to reject aggregation stages with errors about invalid expressions or parsing problems. [[DigitalOcean MongoDB thread](https://discuss.airbyte.io/t/1931)] However, none of the sources describe: - A regex being generated by the MongoDB v2 connector that is “too long,” or - Any configuration option in Airbyte to control or shorten such a regex. Given that, all I can say with confidence from the available material is: - This error is coming directly from MongoDB, not from Airbyte itself. - It is likely triggered by some aggregation or filter the connector is issuing during discovery or sync, but the exact query and how to change it are not documented in the sources you provided. - The official MongoDB v2 troubleshooting guide only documents oplog/change‑stream, cluster type, TLS, and schema‑discovery limitations; it does not mention regex length or a related workaround. [[MongoDB v2 troubleshooting](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations)] Because the knowledge sources don’t go into this error, I can’t reliably suggest a specific Airbyte‑side fix (such as a setting to disable regex use or limit pattern size) without guessing. To move forward, based only on what’s documented: 1. Double‑check that you’re using a supported MongoDB deployment (replica set, TLS/SSL, Atlas tier M10+ if on Atlas). [[MongoDB v2 troubleshooting](https://docs.airbyte.com/integrations/sources/mongodb-v2/mongodb-v2-troubleshooting#connector-limitations)] 2. If possible, capture the exact MongoDB command being run (from MongoDB logs or profiler) when the error occurs, and share it in an Airbyte GitHub issue or forum post so the connector team can see which aggregation or filter is generating the oversized regex. The existing MongoDB v2 issues show that connector bugs around aggregation expressions are handled this way. [[DigitalOcean MongoDB thread](https://discuss.airbyte.io/t/1931)] Beyond that, the knowledge sources do not contain enough information to explain or resolve this specific 51091 regex‑length error.