Skip to content

Commit 55751b2

Browse files
DOCSP-37869 Final Cleanup (#84)
1 parent 462dafd commit 55751b2

25 files changed

+353
-635
lines changed

source/connect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Connect to MongoDB
2424

2525
/connect/mongoclient
2626
/connect/connection-targets
27+
/connect/connection-options
2728
/connect/tls
2829
/connect/network-compression
2930
/connect/server-selection

source/connect/connection-options.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _pymongo-connection-options:
22

3-
==================
4-
Connection Options
5-
==================
3+
==========================
4+
Specify Connection Options
5+
==========================
66

77
.. contents:: On this page
88
:local:

source/data-formats.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ Specialized Data Formats
2121
:titlesonly:
2222
:maxdepth: 1
2323

24+
/data-formats/custom-types
25+
/data-formats/dates-and-times
2426
/data-formats/uuid
2527

26-
- :ref:`pymongo-uuid`
27-
2828
Overview
29-
--------
29+
--------
30+
31+
You can use several types of specialized data formats in your {+driver-short+}
32+
application. To learn how to work with these data formats, see the following
33+
sections:
34+
35+
- Learn how to encode and decode custom types in the :ref:`pymongo-custom-types` guide.
36+
- Learn how to work with Python ``datetime`` objects in {+driver-short+} in the
37+
:ref:`pymongo-dates-times` guide.
38+
- Learn about UUIDs and how to maintain cross-language compatibility while
39+
working with them in the :ref:`pymongo-uuid` guide.

source/data-formats/uuid.txt

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -357,30 +357,7 @@ This will be true if both of the following criteria are met:
357357
Troubleshooting
358358
---------------
359359

360-
ValueError: cannot encode native uuid.UUID with UuidRepresentation.UNSPECIFIED
361-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
362-
363-
This error results from trying to encode a native ``UUID`` object to a ``Binary`` object
364-
when the UUID representation is ``UNSPECIFIED``, as shown in the following code
365-
example:
366-
367-
.. code-block:: python
368-
369-
unspecified_collection.insert_one({'_id': 'bar', 'uuid': uuid4()})
370-
Traceback (most recent call last):
371-
...
372-
ValueError: cannot encode native uuid.UUID with UuidRepresentation.UNSPECIFIED.
373-
UUIDs can be manually converted to bson.Binary instances using bson.Binary.from_uuid()
374-
or a different UuidRepresentation can be configured. See the documentation for
375-
UuidRepresentation for more information.
376-
377-
Instead, you must explicitly convert a native UUID to a ``Binary`` object by using the
378-
``Binary.from_uuid()`` method, as shown in the following example:
379-
380-
.. code-block:: python
381-
382-
explicit_binary = Binary.from_uuid(uuid4(), UuidRepresentation.STANDARD)
383-
unspec_collection.insert_one({'_id': 'bar', 'uuid': explicit_binary})
360+
.. include:: /includes/troubleshooting/uuid.rst
384361

385362
API Documentation
386363
-----------------

source/fundamentals.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

source/get-started.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _pymongo-get-started:
22

3-
===========
4-
Get Started
5-
===========
3+
========================
4+
Get Started with {+driver-short+}
5+
========================
66

77
.. contents:: On this page
88
:local:

source/get-started/create-a-connection-string.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ The connection string includes the hostname or IP address and
1313
port of your deployment, the authentication mechanism, user credentials
1414
when applicable, and connection options.
1515

16-
.. TODO: Link to other connection options pages
17-
.. To connect to an instance or deployment not hosted on Atlas, see
18-
.. :ref:`Other Ways to Connect to MongoDB <pymongo-other-ways-to-connect>`.
16+
To connect to an instance or deployment not hosted on Atlas, see
17+
:ref:`pymongo-connection-targets`.
1918

2019
.. procedure::
2120
:style: connected

source/includes/language-compatibility-table-pymongo.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Python 3
1818
- CPython 3.4
1919
- PyPy3
2020

21-
* - 4.5 to 4.6
21+
* - 4.5 to 4.7
2222
- ✓
2323
- ✓
2424
- ✓

source/includes/mongodb-compatibility-table-pymongo.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- MongoDB 4.0
1313
- MongoDB 3.6
1414

15-
* - 4.4 to 4.6
15+
* - 4.4 to 4.7
1616
- ✓
1717
- ✓
1818
- ✓

source/includes/troubleshooting/connection-targets.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Server Reports Wire Version X, PyMongo Requires Y
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
If you try to connect to MongoDB Server v3.4 or earlier,
5+
{+driver-short+} might raise the following error:
6+
7+
.. code-block::
8+
9+
pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 5, but this version of PyMongo requires at least 6 (MongoDB 3.6).
10+
11+
This occurs when the driver version is too new for the server it's connecting to.
12+
To resolve this issue, upgrade your MongoDB deployment to v3.6 or later, or downgrade to
13+
{+driver-short+} v3.x, which supports MongoDB Server v2.6 and later.
14+
115
AutoReconnect
216
~~~~~~~~~~~~~
317

0 commit comments

Comments
 (0)