v.23.6Improvement

Update MongoDB Protocol to Support Version 5.1 and Newer

Update MongoDB protocol to support MongoDB 5.1 version and newer. Support for the versions with the old protocol (<3.6) is preserved. Closes #45621, #49879. #50061 (Nikolay Degterinsky).
Updated the MongoDB protocol integration in ClickHouse to support MongoDB version 5.1 and newer, while maintaining compatibility with older versions (<3.6).

Why it matters

This update ensures that ClickHouse can communicate effectively with the latest MongoDB versions, enabling users to leverage new MongoDB features and improvements without losing support for legacy MongoDB versions. It resolves compatibility issues and enhances data integration reliability.

How to use it

Users benefit from this feature automatically when connecting to MongoDB servers version 5.1 and above through the MongoDB table engine or integration. No additional configuration is required to enable compatibility with the newer protocol versions.