diff --git a/source/use-cases/product-catalog.txt b/source/use-cases/product-catalog.txt index d4d8f5b4bcd..7d56c60a9c8 100644 --- a/source/use-cases/product-catalog.txt +++ b/source/use-cases/product-catalog.txt @@ -526,27 +526,26 @@ per-connection or per-operation basis. In :api:`PyMongo ` argument. The -:py:attr:`SECONDARY ` +:py:attr:`SECONDARY ` property in the following example, permits reads from a :term:`secondary` (as well as a primary) for the entire connection . .. code-block:: python - conn = pymongo.Connection(read_preference=pymongo.SECONDARY) + conn = pymongo.MongoClient(read_preference=pymongo.SECONDARY) Conversely, the -:py:attr:`SECONDARY_ONLY ` +:py:attr:`SECONDARY_ONLY ` read preference means that the client will only send read operation only to the secondary member .. code-block:: python - conn = pymongo.Connection(read_preference=pymongo.SECONDARY_ONLY) + conn = pymongo.MongoClient(read_preference=pymongo.SECONDARY_ONLY) You can also specify -:py:attr:`read_preference ` -for specific queries, -as follows: +:py:class:`read_preference ` +for specific queries, as follows: .. code-block:: python diff --git a/source/use-cases/storing-log-data.txt b/source/use-cases/storing-log-data.txt index 36cd1eecea9..534dff3ecee 100644 --- a/source/use-cases/storing-log-data.txt +++ b/source/use-cases/storing-log-data.txt @@ -195,7 +195,7 @@ using PyMongo, with an event from the Apache Log: >>> import bson >>> import pymongo >>> from datetime import datetime - >>> conn = pymongo.Connection() + >>> conn = pymongo.MongoClient() >>> db = conn.event_db >>> event = { ... _id: bson.ObjectId(),