As per this document, below code should work:
from pymongo import MongoClient from bson.binary import UuidRepresentation client = MongoClient(conn_str, uuid_representation=UuidRepresentation.STANDARD)
However, the code fails as below:
Exception: ConfigurationError: Unknown option uuid_representation
But an undocumented parameter works:
client = MongoClient(conn_str, uuidRepresentation="standard")
The parameter is in camelCase and not preferred in python coding conventions. Also time-crunch for developer to find this option unless heavy digging through depths of the source code. Only mention I could find was in changelog document, which is not ideal location and does not provide detailed explanation.
Please update the document to suggest developers to use uuidRepresentation instead of uuid_representation in case uuid_representation is old deprecated parameter.
Note: I would prefer to raise such ticket in issues section of GitHub.com. Should not have disabled issues section there. This Jira ticket system is not ideal for external developers, according to me.
- is related to
-
PYTHON-3036 Improve error message for unknown MongoClient options
- Closed