From 3e78d1153ef3c07bad4779133f24057a0c2b339c Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Mon, 6 Dec 2021 10:39:54 -0800 Subject: [PATCH] PYTHON-3033 Fix typo in uuid docs --- doc/examples/uuid.rst | 3 ++- pymongo/mongo_client.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/examples/uuid.rst b/doc/examples/uuid.rst index d4a77d4038..90ec71ebe2 100644 --- a/doc/examples/uuid.rst +++ b/doc/examples/uuid.rst @@ -1,3 +1,4 @@ + .. _handling-uuid-data-example: Handling UUID Data @@ -12,7 +13,7 @@ to MongoDB and retrieve them as native :class:`uuid.UUID` objects:: from uuid import uuid4 # use the 'standard' representation for cross-language compatibility. - client = MongoClient(uuid_representation=UuidRepresentation.STANDARD) + client = MongoClient(uuidRepresentation='standard') collection = client.get_database('uuid_db').get_collection('uuid_coll') # remove all documents from collection diff --git a/pymongo/mongo_client.py b/pymongo/mongo_client.py index af159da521..dae62e7605 100644 --- a/pymongo/mongo_client.py +++ b/pymongo/mongo_client.py @@ -325,9 +325,9 @@ def __init__( speed. 9 is best compression. Defaults to -1. - `uuidRepresentation`: The BSON representation to use when encoding from and decoding to instances of :class:`~uuid.UUID`. Valid - values are `pythonLegacy`, `javaLegacy`, `csharpLegacy`, `standard` - and `unspecified` (the default). New applications - should consider setting this to `standard` for cross language + values are the strings: "standard", "pythonLegacy", "javaLegacy", + "csharpLegacy", and "unspecified" (the default). New applications + should consider setting this to "standard" for cross language compatibility. See :ref:`handling-uuid-data-example` for details. - `unicode_decode_error_handler`: The error handler to apply when a Unicode-related error occurs during BSON decoding that would