Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > bf9ddee8352dabf2ba1d26636a349741 > files > 413

python2-pymongo-3.7.2-1.mga7.armv7hl.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Changelog &#8212; PyMongo 3.7.2 documentation</title>
    <link rel="stylesheet" href="_static/pydoctheme.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    
    <script type="text/javascript" src="_static/sidebar.js"></script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Python 3 FAQ" href="python3.html" />
    <link rel="prev" title="Contributors" href="contributors.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="python3.html" title="Python 3 FAQ"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="contributors.html" title="Contributors"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">PyMongo 3.7.2 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="changelog">
<h1>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline">¶</a></h1>
<div class="section" id="changes-in-version-3-7-2">
<h2>Changes in Version 3.7.2<a class="headerlink" href="#changes-in-version-3-7-2" title="Permalink to this headline">¶</a></h2>
<p>Version 3.7.2 fixes a few issues discovered since the release of 3.7.1.</p>
<ul class="simple">
<li>Fixed a bug in retryable writes where a previous command’s “txnNumber”
field could be sent leading to incorrect results.</li>
<li>Fixed a memory leak of a few bytes on some insert, update, or delete
commands when running against MongoDB 3.6+.</li>
<li>Fixed a bug that caused <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.ensure_index" title="pymongo.collection.Collection.ensure_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.collection.Collection.ensure_index()</span></code></a>
to only cache a single index per database.</li>
<li>Updated the documentation examples to use
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count_documents" title="pymongo.collection.Collection.count_documents"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.collection.Collection.count_documents()</span></code></a> instead of
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count" title="pymongo.collection.Collection.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.collection.Collection.count()</span></code></a> and
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.count" title="pymongo.cursor.Cursor.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.cursor.Cursor.count()</span></code></a>.</li>
</ul>
<div class="section" id="issues-resolved">
<h3>Issues Resolved<a class="headerlink" href="#issues-resolved" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=21519">PyMongo 3.7.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-7-1">
<h2>Changes in Version 3.7.1<a class="headerlink" href="#changes-in-version-3-7-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.7.1 fixes a few issues discovered since the release of 3.7.0.</p>
<ul class="simple">
<li>Calling <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.authenticate" title="pymongo.database.Database.authenticate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">authenticate()</span></code></a> more than once
with the same credentials results in OperationFailure.</li>
<li>Authentication fails when SCRAM-SHA-1 is used to authenticate users with
only MONGODB-CR credentials.</li>
<li>A millisecond rounding problem when decoding datetimes in the pure Python
BSON decoder on 32 bit systems and AWS lambda.</li>
</ul>
<div class="section" id="id1">
<h3>Issues Resolved<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=21096">PyMongo 3.7.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-7-0">
<h2>Changes in Version 3.7.0<a class="headerlink" href="#changes-in-version-3-7-0" title="Permalink to this headline">¶</a></h2>
<p>Version 3.7 adds support for MongoDB 4.0. Highlights include:</p>
<ul class="simple">
<li>Support for single replica set multi-document ACID transactions.
See <a class="reference internal" href="api/pymongo/client_session.html#transactions-ref"><span class="std std-ref">Transactions</span></a>.</li>
<li>Support for wire protocol compression. See the
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-meth docutils literal notranslate"><span class="pre">MongoClient()</span></code></a> documentation for details.</li>
<li>Support for Python 3.7.</li>
<li>New count methods, <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count_documents" title="pymongo.collection.Collection.count_documents"><code class="xref py py-meth docutils literal notranslate"><span class="pre">count_documents()</span></code></a>
and <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.estimated_document_count" title="pymongo.collection.Collection.estimated_document_count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">estimated_document_count()</span></code></a>.
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count_documents" title="pymongo.collection.Collection.count_documents"><code class="xref py py-meth docutils literal notranslate"><span class="pre">count_documents()</span></code></a> is always
accurate when used with MongoDB 3.6+, or when used with older standalone
or replica set deployments. With older sharded clusters is it always
accurate when used with Primary read preference. It can also be used in
a transaction, unlike the now deprecated
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count" title="pymongo.collection.Collection.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.collection.Collection.count()</span></code></a> and
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.count" title="pymongo.cursor.Cursor.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.cursor.Cursor.count()</span></code></a> methods.</li>
<li>Support for watching changes on all collections in a database using the
new <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.watch" title="pymongo.database.Database.watch"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.database.Database.watch()</span></code></a> method.</li>
<li>Support for watching changes on all collections in all databases using the
new <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.watch" title="pymongo.mongo_client.MongoClient.watch"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.mongo_client.MongoClient.watch()</span></code></a> method.</li>
<li>Support for watching changes starting at a user provided timestamp using the
new <code class="docutils literal notranslate"><span class="pre">start_at_operation_time</span></code> parameter for the <code class="docutils literal notranslate"><span class="pre">watch()</span></code> helpers.</li>
<li>Better support for using PyMongo in a FIPS 140-2 environment. Specifically,
the following features and changes allow PyMongo to function when MD5 support
is disabled in OpenSSL by the FIPS Object Module:<ul>
<li>Support for the <a class="reference internal" href="examples/authentication.html#scram-sha-256"><span class="std std-ref">SCRAM-SHA-256</span></a>
authentication mechanism. The <a class="reference internal" href="examples/authentication.html#gssapi"><span class="std std-ref">GSSAPI</span></a>,
<a class="reference internal" href="examples/authentication.html#sasl-plain"><span class="std std-ref">PLAIN</span></a>, and <a class="reference internal" href="examples/authentication.html#mongodb-x509"><span class="std std-ref">MONGODB-X509</span></a>
mechanisms can also be used to avoid issues with OpenSSL in FIPS
environments.</li>
<li>MD5 checksums are now optional in GridFS. See the <cite>disable_md5</cite> option
of <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS" title="gridfs.GridFS"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridFS</span></code></a> and <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFSBucket" title="gridfs.GridFSBucket"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridFSBucket</span></code></a>.</li>
<li><a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a> machine bytes are now hashed using
<a class="reference external" href="https://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function">FNV-1a</a>
instead of MD5.</li>
</ul>
</li>
<li>The <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.list_collection_names" title="pymongo.database.Database.list_collection_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_collection_names()</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.collection_names" title="pymongo.database.Database.collection_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">collection_names()</span></code></a> methods use
the nameOnly option when supported by MongoDB.</li>
<li>The <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.watch" title="pymongo.collection.Collection.watch"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.collection.Collection.watch()</span></code></a> method now returns an
instance of the <a class="reference internal" href="api/pymongo/change_stream.html#pymongo.change_stream.CollectionChangeStream" title="pymongo.change_stream.CollectionChangeStream"><code class="xref py py-class docutils literal notranslate"><span class="pre">CollectionChangeStream</span></code></a>
class which is a subclass of <a class="reference internal" href="api/pymongo/change_stream.html#pymongo.change_stream.ChangeStream" title="pymongo.change_stream.ChangeStream"><code class="xref py py-class docutils literal notranslate"><span class="pre">ChangeStream</span></code></a>.</li>
<li>SCRAM client and server keys are cached for improved performance, following
<a class="reference external" href="https://tools.ietf.org/html/rfc5802">RFC 5802</a>.</li>
<li>If not specified, the authSource for the <a class="reference internal" href="examples/authentication.html#sasl-plain"><span class="std std-ref">PLAIN</span></a>
authentication mechanism defaults to $external.</li>
<li>wtimeoutMS is once again supported as a URI option.</li>
<li>When using unacknowledged write concern and connected to MongoDB server
version 3.6 or greater, the <cite>bypass_document_validation</cite> option is now
supported in the following write helpers:
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert_one" title="pymongo.collection.Collection.insert_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert_one()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.replace_one" title="pymongo.collection.Collection.replace_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">replace_one()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_one" title="pymongo.collection.Collection.update_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_one()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_many" title="pymongo.collection.Collection.update_many"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_many()</span></code></a>.</li>
</ul>
<p>Deprecations:</p>
<ul class="simple">
<li>Deprecated <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count" title="pymongo.collection.Collection.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.collection.Collection.count()</span></code></a> and
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.count" title="pymongo.cursor.Cursor.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.cursor.Cursor.count()</span></code></a>. These two methods use the <cite>count</cite>
command and <a class="reference external" href="https://docs.mongodb.com/manual/reference/command/count/#behavior">may or may not be accurate</a>,
depending on the options used and connected MongoDB topology. Use
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count_documents" title="pymongo.collection.Collection.count_documents"><code class="xref py py-meth docutils literal notranslate"><span class="pre">count_documents()</span></code></a> instead.</li>
<li>Deprecated the snapshot option of <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a>
and <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one" title="pymongo.collection.Collection.find_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one()</span></code></a>. The option was
deprecated in MongoDB 3.6 and removed in MongoDB 4.0.</li>
<li>Deprecated the max_scan option of <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a>
and <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one" title="pymongo.collection.Collection.find_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one()</span></code></a>. The option was
deprecated in MongoDB 4.0. Use <cite>maxTimeMS</cite> instead.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.close_cursor" title="pymongo.mongo_client.MongoClient.close_cursor"><code class="xref py py-meth docutils literal notranslate"><span class="pre">close_cursor()</span></code></a>. Use
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.close" title="pymongo.cursor.Cursor.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">close()</span></code></a> instead.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.database_names" title="pymongo.mongo_client.MongoClient.database_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">database_names()</span></code></a>. Use
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.list_database_names" title="pymongo.mongo_client.MongoClient.list_database_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_database_names()</span></code></a> instead.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.collection_names" title="pymongo.database.Database.collection_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">collection_names()</span></code></a>. Use
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.list_collection_names" title="pymongo.database.Database.list_collection_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_collection_names()</span></code></a> instead.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.parallel_scan" title="pymongo.collection.Collection.parallel_scan"><code class="xref py py-meth docutils literal notranslate"><span class="pre">parallel_scan()</span></code></a>. MongoDB 4.2
will remove the parallelCollectionScan command.</li>
</ul>
<p>Unavoidable breaking changes:</p>
<ul class="simple">
<li>Commands that fail with server error codes 10107, 13435, 13436, 11600,
11602, 189, 91 (NotMaster, NotMasterNoSlaveOk, NotMasterOrSecondary,
InterruptedAtShutdown, InterruptedDueToReplStateChange,
PrimarySteppedDown, ShutdownInProgress respectively) now always raise
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.NotMasterError" title="pymongo.errors.NotMasterError"><code class="xref py py-class docutils literal notranslate"><span class="pre">NotMasterError</span></code></a> instead of
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.OperationFailure" title="pymongo.errors.OperationFailure"><code class="xref py py-class docutils literal notranslate"><span class="pre">OperationFailure</span></code></a>.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.parallel_scan" title="pymongo.collection.Collection.parallel_scan"><code class="xref py py-meth docutils literal notranslate"><span class="pre">parallel_scan()</span></code></a> no longer uses an
implicit session. Explicit sessions are still supported.</li>
<li>Unacknowledged writes (<code class="docutils literal notranslate"><span class="pre">w=0</span></code>) with an explicit <code class="docutils literal notranslate"><span class="pre">session</span></code> parameter now
raise a client side error. Since PyMongo does not wait for a response for an
unacknowledged write, two unacknowledged writes run serially by the client
may be executed simultaneously on the server. However, the server requires a
single session must not be used simultaneously by more than one operation.
Therefore explicit sessions cannot support unacknowledged writes.
Unacknowledged writes without a <code class="docutils literal notranslate"><span class="pre">session</span></code> parameter are still supported.</li>
</ul>
<div class="section" id="id2">
<h3>Issues Resolved<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=19287">PyMongo 3.7 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-6-1">
<h2>Changes in Version 3.6.1<a class="headerlink" href="#changes-in-version-3-6-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.6.1 fixes bugs reported since the release of 3.6.0:</p>
<ul class="simple">
<li>Fix regression in PyMongo 3.5.0 that causes idle sockets to be closed almost
instantly when <code class="docutils literal notranslate"><span class="pre">maxIdleTimeMS</span></code> is set. Idle sockets are now closed after
<code class="docutils literal notranslate"><span class="pre">maxIdleTimeMS</span></code> milliseconds.</li>
<li><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.max_idle_time_ms" title="pymongo.mongo_client.MongoClient.max_idle_time_ms"><code class="xref py py-attr docutils literal notranslate"><span class="pre">pymongo.mongo_client.MongoClient.max_idle_time_ms</span></code></a> now returns
milliseconds instead of seconds.</li>
<li>Properly import and use the
<a class="reference external" href="https://pypi.python.org/pypi/monotonic">monotonic</a>
library for monotonic time when it is installed.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a> now ignores the
<code class="docutils literal notranslate"><span class="pre">batchSize</span></code> argument when running a pipeline with a <code class="docutils literal notranslate"><span class="pre">$out</span></code> stage.</li>
<li>Always send handshake metadata for new connections.</li>
</ul>
<div class="section" id="id3">
<h3>Issues Resolved<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=19438">PyMongo 3.6.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-6-0">
<h2>Changes in Version 3.6.0<a class="headerlink" href="#changes-in-version-3-6-0" title="Permalink to this headline">¶</a></h2>
<p>Version 3.6 adds support for MongoDB 3.6, drops support for CPython 3.3 (PyPy3
is still supported), and drops support for MongoDB versions older than 2.6. If
connecting to a MongoDB 2.4 server or older, PyMongo now throws a
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConfigurationError" title="pymongo.errors.ConfigurationError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ConfigurationError</span></code></a>.</p>
<p>Highlights include:</p>
<ul class="simple">
<li>Support for change streams. See the
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.watch" title="pymongo.collection.Collection.watch"><code class="xref py py-meth docutils literal notranslate"><span class="pre">watch()</span></code></a> method for details.</li>
<li>Support for array_filters in
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_one" title="pymongo.collection.Collection.update_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_one()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_many" title="pymongo.collection.Collection.update_many"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_many()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_update" title="pymongo.collection.Collection.find_one_and_update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_update()</span></code></a>,
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.UpdateOne" title="pymongo.operations.UpdateOne"><code class="xref py py-meth docutils literal notranslate"><span class="pre">UpdateOne()</span></code></a>, and
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.UpdateMany" title="pymongo.operations.UpdateMany"><code class="xref py py-meth docutils literal notranslate"><span class="pre">UpdateMany()</span></code></a>.</li>
<li>New Session API, see <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.start_session" title="pymongo.mongo_client.MongoClient.start_session"><code class="xref py py-meth docutils literal notranslate"><span class="pre">start_session()</span></code></a>.</li>
<li>New methods <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_raw_batches" title="pymongo.collection.Collection.find_raw_batches"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_raw_batches()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate_raw_batches" title="pymongo.collection.Collection.aggregate_raw_batches"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate_raw_batches()</span></code></a> for use with
external libraries that can parse raw batches of BSON data.</li>
<li>New methods <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.list_databases" title="pymongo.mongo_client.MongoClient.list_databases"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_databases()</span></code></a> and
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.list_database_names" title="pymongo.mongo_client.MongoClient.list_database_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_database_names()</span></code></a>.</li>
<li>New methods <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.list_collections" title="pymongo.database.Database.list_collections"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_collections()</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.list_collection_names" title="pymongo.database.Database.list_collection_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_collection_names()</span></code></a>.</li>
<li>Support for mongodb+srv:// URIs. See
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> for details.</li>
<li>Index management helpers
(<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_index" title="pymongo.collection.Collection.create_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_index()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_indexes" title="pymongo.collection.Collection.create_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_indexes()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_index" title="pymongo.collection.Collection.drop_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_index()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_indexes" title="pymongo.collection.Collection.drop_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_indexes()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.reindex" title="pymongo.collection.Collection.reindex"><code class="xref py py-meth docutils literal notranslate"><span class="pre">reindex()</span></code></a>) now support maxTimeMS.</li>
<li>Support for retryable writes and the <code class="docutils literal notranslate"><span class="pre">retryWrites</span></code> URI option.  See
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> for details.</li>
</ul>
<p>Deprecations:</p>
<ul class="simple">
<li>The <cite>useCursor</cite> option for <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a>
is deprecated. The option was only necessary when upgrading from MongoDB
2.4 to MongoDB 2.6. MongoDB 2.4 is no longer supported.</li>
<li>The <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.add_user" title="pymongo.database.Database.add_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_user()</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.remove_user" title="pymongo.database.Database.remove_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove_user()</span></code></a> methods are deprecated. See
the method docstrings for alternatives.</li>
</ul>
<p>Unavoidable breaking changes:</p>
<ul class="simple">
<li>Starting in MongoDB 3.6, the deprecated methods
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.authenticate" title="pymongo.database.Database.authenticate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">authenticate()</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.logout" title="pymongo.database.Database.logout"><code class="xref py py-meth docutils literal notranslate"><span class="pre">logout()</span></code></a> now invalidate all cursors created
prior. Instead of using these methods to change credentials, pass credentials
for one user to the <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> at construction
time, and either grant access to several databases to one user account, or use
a distinct client object for each user.</li>
<li>BSON binary subtype 4 is decoded using RFC-4122 byte order regardless
of the UUID representation. This is a change in behavior for applications
that use UUID representation <a class="reference internal" href="api/bson/binary.html#bson.binary.JAVA_LEGACY" title="bson.binary.JAVA_LEGACY"><code class="xref py py-data docutils literal notranslate"><span class="pre">bson.binary.JAVA_LEGACY</span></code></a> or
<a class="reference internal" href="api/bson/binary.html#bson.binary.CSHARP_LEGACY" title="bson.binary.CSHARP_LEGACY"><code class="xref py py-data docutils literal notranslate"><span class="pre">bson.binary.CSHARP_LEGACY</span></code></a> to decode BSON binary subtype 4. Other
UUID representations, <a class="reference internal" href="api/bson/binary.html#bson.binary.PYTHON_LEGACY" title="bson.binary.PYTHON_LEGACY"><code class="xref py py-data docutils literal notranslate"><span class="pre">bson.binary.PYTHON_LEGACY</span></code></a> (the default) and
<a class="reference internal" href="api/bson/binary.html#bson.binary.STANDARD" title="bson.binary.STANDARD"><code class="xref py py-data docutils literal notranslate"><span class="pre">bson.binary.STANDARD</span></code></a>, and the decoding of BSON binary subtype 3
are unchanged.</li>
</ul>
<div class="section" id="id4">
<h3>Issues Resolved<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=18043">PyMongo 3.6 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-5-1">
<h2>Changes in Version 3.5.1<a class="headerlink" href="#changes-in-version-3-5-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.5.1 fixes bugs reported since the release of 3.5.0:</p>
<ul class="simple">
<li>Work around socket.getsockopt issue with NetBSD.</li>
<li><a class="reference internal" href="api/pymongo/command_cursor.html#pymongo.command_cursor.CommandCursor.close" title="pymongo.command_cursor.CommandCursor.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.command_cursor.CommandCursor.close()</span></code></a> now closes
the cursor synchronously instead of deferring to a background
thread.</li>
<li>Fix documentation build warnings with Sphinx 1.6.x.</li>
</ul>
<div class="section" id="id5">
<h3>Issues Resolved<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=18721">PyMongo 3.5.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-5">
<h2>Changes in Version 3.5<a class="headerlink" href="#changes-in-version-3-5" title="Permalink to this headline">¶</a></h2>
<p>Version 3.5 implements a number of improvements and bug fixes:</p>
<p>Highlights include:</p>
<ul class="simple">
<li>Username and password can be passed to
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> as keyword arguments. Before, the
only way to pass them was in the URI.</li>
<li>Increased the performance of using <a class="reference internal" href="api/bson/raw_bson.html#bson.raw_bson.RawBSONDocument" title="bson.raw_bson.RawBSONDocument"><code class="xref py py-class docutils literal notranslate"><span class="pre">RawBSONDocument</span></code></a>.</li>
<li>Increased the performance of
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.database_names" title="pymongo.mongo_client.MongoClient.database_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">database_names()</span></code></a> by using the
<cite>nameOnly</cite> option for listDatabases when available.</li>
<li>Increased the performance of
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.bulk_write" title="pymongo.collection.Collection.bulk_write"><code class="xref py py-meth docutils literal notranslate"><span class="pre">bulk_write()</span></code></a> by reducing the memory
overhead of <a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.InsertOne" title="pymongo.operations.InsertOne"><code class="xref py py-class docutils literal notranslate"><span class="pre">InsertOne</span></code></a>,
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.DeleteOne" title="pymongo.operations.DeleteOne"><code class="xref py py-class docutils literal notranslate"><span class="pre">DeleteOne</span></code></a>, and
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.DeleteMany" title="pymongo.operations.DeleteMany"><code class="xref py py-class docutils literal notranslate"><span class="pre">DeleteMany</span></code></a>.</li>
<li>Added the <cite>collation</cite> option to <a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.DeleteOne" title="pymongo.operations.DeleteOne"><code class="xref py py-class docutils literal notranslate"><span class="pre">DeleteOne</span></code></a>,
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.DeleteMany" title="pymongo.operations.DeleteMany"><code class="xref py py-class docutils literal notranslate"><span class="pre">DeleteMany</span></code></a>,
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.ReplaceOne" title="pymongo.operations.ReplaceOne"><code class="xref py py-class docutils literal notranslate"><span class="pre">ReplaceOne</span></code></a>,
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.UpdateOne" title="pymongo.operations.UpdateOne"><code class="xref py py-class docutils literal notranslate"><span class="pre">UpdateOne</span></code></a>, and
<a class="reference internal" href="api/pymongo/operations.html#pymongo.operations.UpdateMany" title="pymongo.operations.UpdateMany"><code class="xref py py-class docutils literal notranslate"><span class="pre">UpdateMany</span></code></a>.</li>
<li>Implemented the <a class="reference external" href="https://github.com/mongodb/specifications/blob/master/source/extended-json.rst">MongoDB Extended JSON</a>
specification.</li>
<li><a class="reference internal" href="api/bson/decimal128.html#bson.decimal128.Decimal128" title="bson.decimal128.Decimal128"><code class="xref py py-class docutils literal notranslate"><span class="pre">Decimal128</span></code></a> now works when cdecimal is installed.</li>
<li>PyMongo is now tested against a wider array of operating systems and CPU
architectures (including s390x, ARM64, and POWER8).</li>
</ul>
<p>Changes and Deprecations:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a> has new options <cite>return_key</cite>,
<cite>show_record_id</cite>, <cite>snapshot</cite>, <cite>hint</cite>, <cite>max_time_ms</cite>, <cite>max_scan</cite>, <cite>min</cite>, <cite>max</cite>,
and <cite>comment</cite>. Deprecated the option <cite>modifiers</cite>.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a>. The group command
was deprecated in MongoDB 3.4 and is expected to be removed in MongoDB 3.6.
Applications should use <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a>
with the <cite>$group</cite> pipeline stage instead.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.authenticate" title="pymongo.database.Database.authenticate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">authenticate()</span></code></a>. Authenticating
multiple users conflicts with support for logical sessions in MongoDB 3.6.
To authenticate as multiple users, create multiple instances of
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a>.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.eval" title="pymongo.database.Database.eval"><code class="xref py py-meth docutils literal notranslate"><span class="pre">eval()</span></code></a>. The eval command
was deprecated in MongoDB 3.0 and will be removed in a future server version.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/database.html#pymongo.database.SystemJS" title="pymongo.database.SystemJS"><code class="xref py py-class docutils literal notranslate"><span class="pre">SystemJS</span></code></a>.</li>
<li>Deprecated <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.get_default_database" title="pymongo.mongo_client.MongoClient.get_default_database"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_default_database()</span></code></a>.
Applications should use
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.get_database" title="pymongo.mongo_client.MongoClient.get_database"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_database()</span></code></a> without the <cite>name</cite>
parameter instead.</li>
<li>Deprecated the MongoClient option <cite>socketKeepAlive</cite>. It now defaults to true
and disabling it is not recommended, see <a class="reference external" href="https://docs.mongodb.com/manual/faq/diagnostics/#does-tcp-keepalive-time-affect-mongodb-deployments">does TCP keepalive time affect
MongoDB Deployments?</a></li>
<li>Deprecated <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.initialize_ordered_bulk_op" title="pymongo.collection.Collection.initialize_ordered_bulk_op"><code class="xref py py-meth docutils literal notranslate"><span class="pre">initialize_ordered_bulk_op()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.initialize_unordered_bulk_op" title="pymongo.collection.Collection.initialize_unordered_bulk_op"><code class="xref py py-meth docutils literal notranslate"><span class="pre">initialize_unordered_bulk_op()</span></code></a>, and
<a class="reference internal" href="api/pymongo/bulk.html#pymongo.bulk.BulkOperationBuilder" title="pymongo.bulk.BulkOperationBuilder"><code class="xref py py-class docutils literal notranslate"><span class="pre">BulkOperationBuilder</span></code></a>. Use
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.bulk_write" title="pymongo.collection.Collection.bulk_write"><code class="xref py py-meth docutils literal notranslate"><span class="pre">bulk_write()</span></code></a> instead.</li>
<li>Deprecated <a class="reference internal" href="api/bson/json_util.html#bson.json_util.STRICT_JSON_OPTIONS" title="bson.json_util.STRICT_JSON_OPTIONS"><code class="xref py py-const docutils literal notranslate"><span class="pre">STRICT_JSON_OPTIONS</span></code></a>. Use
<a class="reference internal" href="api/bson/json_util.html#bson.json_util.RELAXED_JSON_OPTIONS" title="bson.json_util.RELAXED_JSON_OPTIONS"><code class="xref py py-const docutils literal notranslate"><span class="pre">RELAXED_JSON_OPTIONS</span></code></a> or
<a class="reference internal" href="api/bson/json_util.html#bson.json_util.CANONICAL_JSON_OPTIONS" title="bson.json_util.CANONICAL_JSON_OPTIONS"><code class="xref py py-const docutils literal notranslate"><span class="pre">CANONICAL_JSON_OPTIONS</span></code></a> instead.</li>
<li>If a custom <a class="reference internal" href="api/bson/codec_options.html#bson.codec_options.CodecOptions" title="bson.codec_options.CodecOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">CodecOptions</span></code></a> is passed to
<code class="xref py py-class docutils literal notranslate"><span class="pre">RawBSONDocument</span></code>, its <cite>document_class</cite> must be
<code class="xref py py-class docutils literal notranslate"><span class="pre">RawBSONDocument</span></code>.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.list_indexes" title="pymongo.collection.Collection.list_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_indexes()</span></code></a> no longer raises
OperationFailure when the collection (or database) does not exist on
MongoDB &gt;= 3.0. Instead, it returns an empty
<a class="reference internal" href="api/pymongo/command_cursor.html#pymongo.command_cursor.CommandCursor" title="pymongo.command_cursor.CommandCursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">CommandCursor</span></code></a> to make the behavior
consistent across all MongoDB versions.</li>
<li>In Python 3, <a class="reference internal" href="api/bson/json_util.html#bson.json_util.loads" title="bson.json_util.loads"><code class="xref py py-meth docutils literal notranslate"><span class="pre">loads()</span></code></a> now automatically decodes JSON
$binary with a subtype of 0 into <code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code> instead of
<a class="reference internal" href="api/bson/binary.html#bson.binary.Binary" title="bson.binary.Binary"><code class="xref py py-class docutils literal notranslate"><span class="pre">Binary</span></code></a>. See the <a class="reference internal" href="python3.html"><span class="doc">Python 3 FAQ</span></a> for more details.</li>
<li><a class="reference internal" href="api/bson/json_util.html#bson.json_util.loads" title="bson.json_util.loads"><code class="xref py py-meth docutils literal notranslate"><span class="pre">loads()</span></code></a> now raises <code class="docutils literal notranslate"><span class="pre">TypeError</span></code> or <code class="docutils literal notranslate"><span class="pre">ValueError</span></code>
when parsing JSON type wrappers with values of the wrong type or any
extra keys.</li>
<li><a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.close" title="pymongo.cursor.Cursor.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.cursor.Cursor.close()</span></code></a> and
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.close" title="pymongo.mongo_client.MongoClient.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.mongo_client.MongoClient.close()</span></code></a>
now kill cursors synchronously instead of deferring to a background thread.</li>
<li><a class="reference internal" href="api/pymongo/uri_parser.html#pymongo.uri_parser.parse_uri" title="pymongo.uri_parser.parse_uri"><code class="xref py py-meth docutils literal notranslate"><span class="pre">parse_uri()</span></code></a> now returns the original value
of the <code class="docutils literal notranslate"><span class="pre">readPreference</span></code> MongoDB URI option instead of the validated read
preference mode.</li>
</ul>
<div class="section" id="id6">
<h3>Issues Resolved<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=17590">PyMongo 3.5 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-4">
<h2>Changes in Version 3.4<a class="headerlink" href="#changes-in-version-3-4" title="Permalink to this headline">¶</a></h2>
<p>Version 3.4 implements the new server features introduced in MongoDB 3.4
and a whole lot more:</p>
<p>Highlights include:</p>
<ul class="simple">
<li>Complete support for MongoDB 3.4:<ul>
<li>Unicode aware string comparison using <a class="reference internal" href="examples/collations.html"><span class="doc">Collations</span></a>.</li>
<li>Support for the new <a class="reference internal" href="api/bson/decimal128.html#bson.decimal128.Decimal128" title="bson.decimal128.Decimal128"><code class="xref py py-class docutils literal notranslate"><span class="pre">Decimal128</span></code></a> BSON type.</li>
<li>A new maxStalenessSeconds read preference option.</li>
<li>A username is no longer required for the MONGODB-X509 authentication
mechanism when connected to MongoDB &gt;= 3.4.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.parallel_scan" title="pymongo.collection.Collection.parallel_scan"><code class="xref py py-meth docutils literal notranslate"><span class="pre">parallel_scan()</span></code></a> supports maxTimeMS.</li>
<li><a class="reference internal" href="api/pymongo/write_concern.html#pymongo.write_concern.WriteConcern" title="pymongo.write_concern.WriteConcern"><code class="xref py py-attr docutils literal notranslate"><span class="pre">WriteConcern</span></code></a> is automatically
applied by all helpers for commands that write to the database when
connected to MongoDB 3.4+. This change affects the following helpers:<ul>
<li><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.drop_database" title="pymongo.mongo_client.MongoClient.drop_database"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_database()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.create_collection" title="pymongo.database.Database.create_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_collection()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.drop_collection" title="pymongo.database.Database.drop_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_collection()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a> (when using $out)</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_indexes" title="pymongo.collection.Collection.create_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_indexes()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_index" title="pymongo.collection.Collection.create_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_index()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_indexes" title="pymongo.collection.Collection.drop_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_indexes()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_indexes" title="pymongo.collection.Collection.drop_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_indexes()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_index" title="pymongo.collection.Collection.drop_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_index()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.map_reduce" title="pymongo.collection.Collection.map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">map_reduce()</span></code></a> (when output is not
“inline”)</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.reindex" title="pymongo.collection.Collection.reindex"><code class="xref py py-meth docutils literal notranslate"><span class="pre">reindex()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.rename" title="pymongo.collection.Collection.rename"><code class="xref py py-meth docutils literal notranslate"><span class="pre">rename()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li>Improved support for logging server discovery and monitoring events. See
<a class="reference internal" href="api/pymongo/monitoring.html#module-pymongo.monitoring" title="pymongo.monitoring: Tools for monitoring driver events."><code class="xref py py-mod docutils literal notranslate"><span class="pre">monitoring</span></code></a> for examples.</li>
<li>Support for matching iPAddress subjectAltName values for TLS certificate
verification.</li>
<li>TLS compression is now explicitly disabled when possible.</li>
<li>The Server Name Indication (SNI) TLS extension is used when possible.</li>
<li>Finer control over JSON encoding/decoding with
<a class="reference internal" href="api/bson/json_util.html#bson.json_util.JSONOptions" title="bson.json_util.JSONOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">JSONOptions</span></code></a>.</li>
<li>Allow <a class="reference internal" href="api/bson/code.html#bson.code.Code" title="bson.code.Code"><code class="xref py py-class docutils literal notranslate"><span class="pre">Code</span></code></a> objects to have a scope of <code class="docutils literal notranslate"><span class="pre">None</span></code>,
signifying no scope. Also allow encoding Code objects with an empty scope
(i.e. <code class="docutils literal notranslate"><span class="pre">{}</span></code>).</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Starting in PyMongo 3.4, <a class="reference internal" href="api/bson/code.html#bson.code.Code.scope" title="bson.code.Code.scope"><code class="xref py py-attr docutils literal notranslate"><span class="pre">bson.code.Code.scope</span></code></a> may return
<code class="docutils literal notranslate"><span class="pre">None</span></code>, as the default scope is <code class="docutils literal notranslate"><span class="pre">None</span></code> instead of <code class="docutils literal notranslate"><span class="pre">{}</span></code>.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">PyMongo 3.4+ attempts to create sockets non-inheritable when possible
(i.e. it sets the close-on-exec flag on socket file descriptors). Support
is limited to a subset of POSIX operating systems (not including Windows) and
the flag usually cannot be set in a single atomic operation. CPython 3.4+
implements <a class="reference external" href="https://www.python.org/dev/peps/pep-0446/">PEP 446</a>, creating all file descriptors non-inheritable by
default. Users that require this behavior are encouraged to upgrade to
CPython 3.4+.</p>
</div>
<p>Since 3.4rc0, the max staleness option has been renamed from <code class="docutils literal notranslate"><span class="pre">maxStalenessMS</span></code>
to <code class="docutils literal notranslate"><span class="pre">maxStalenessSeconds</span></code>, its smallest value has changed from twice
<code class="docutils literal notranslate"><span class="pre">heartbeatFrequencyMS</span></code> to 90 seconds, and its default value has changed from
<code class="docutils literal notranslate"><span class="pre">None</span></code> or 0 to -1.</p>
<div class="section" id="id7">
<h3>Issues Resolved<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16594">PyMongo 3.4 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-3-1">
<h2>Changes in Version 3.3.1<a class="headerlink" href="#changes-in-version-3-3-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.3.1 fixes a memory leak when decoding elements inside of a
<a class="reference internal" href="api/bson/raw_bson.html#bson.raw_bson.RawBSONDocument" title="bson.raw_bson.RawBSONDocument"><code class="xref py py-class docutils literal notranslate"><span class="pre">RawBSONDocument</span></code></a>.</p>
<div class="section" id="id8">
<h3>Issues Resolved<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=17636">PyMongo 3.3.1 release notes in Jira</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-3">
<h2>Changes in Version 3.3<a class="headerlink" href="#changes-in-version-3-3" title="Permalink to this headline">¶</a></h2>
<p>Version 3.3 adds the following major new features:</p>
<ul class="simple">
<li>C extensions support on big endian systems.</li>
<li>Kerberos authentication support on Windows using <a class="reference external" href="https://pypi.python.org/pypi/winkerberos">WinKerberos</a>.</li>
<li>A new <code class="docutils literal notranslate"><span class="pre">ssl_clrfile</span></code> option to support certificate revocation lists.</li>
<li>A new <code class="docutils literal notranslate"><span class="pre">ssl_pem_passphrase</span></code> option to support encrypted key files.</li>
<li>Support for publishing server discovery and monitoring events. See
<a class="reference internal" href="api/pymongo/monitoring.html#module-pymongo.monitoring" title="pymongo.monitoring: Tools for monitoring driver events."><code class="xref py py-mod docutils literal notranslate"><span class="pre">monitoring</span></code></a> for details.</li>
<li>New connection pool options <code class="docutils literal notranslate"><span class="pre">minPoolSize</span></code> and <code class="docutils literal notranslate"><span class="pre">maxIdleTimeMS</span></code>.</li>
<li>New <code class="docutils literal notranslate"><span class="pre">heartbeatFrequencyMS</span></code> option controls the rate at which background
monitoring threads re-check servers. Default is once every 10 seconds.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">PyMongo 3.3 drops support for MongoDB versions older than 2.4.
It also drops support for python 3.2 (pypy3 continues to be supported).</p>
</div>
<div class="section" id="id9">
<h3>Issues Resolved<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16005">PyMongo 3.3 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-2-2">
<h2>Changes in Version 3.2.2<a class="headerlink" href="#changes-in-version-3-2-2" title="Permalink to this headline">¶</a></h2>
<p>Version 3.2.2 fixes a few issues reported since the release of 3.2.1, including
a fix for using the <cite>connect</cite> option in the MongoDB URI and support for setting
the batch size for a query to 1 when using MongoDB 3.2+.</p>
<div class="section" id="id10">
<h3>Issues Resolved<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16538">PyMongo 3.2.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-2-1">
<h2>Changes in Version 3.2.1<a class="headerlink" href="#changes-in-version-3-2-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.2.1 fixes a few issues reported since the release of 3.2, including
running the mapreduce command twice when calling the
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.inline_map_reduce" title="pymongo.collection.Collection.inline_map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">inline_map_reduce()</span></code></a> method and a
<code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code> being raised when calling
<a class="reference internal" href="api/gridfs/index.html#gridfs.GridFSBucket.download_to_stream" title="gridfs.GridFSBucket.download_to_stream"><code class="xref py py-meth docutils literal notranslate"><span class="pre">download_to_stream()</span></code></a>. This release also
improves error messaging around BSON decoding.</p>
<div class="section" id="id11">
<h3>Issues Resolved<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16312">PyMongo 3.2.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-2">
<h2>Changes in Version 3.2<a class="headerlink" href="#changes-in-version-3-2" title="Permalink to this headline">¶</a></h2>
<p>Version 3.2 implements the new server features introduced in MongoDB 3.2.</p>
<p>Highlights include:</p>
<ul class="simple">
<li>Full support for MongoDB 3.2 including:<ul>
<li>Support for <a class="reference internal" href="api/pymongo/read_concern.html#pymongo.read_concern.ReadConcern" title="pymongo.read_concern.ReadConcern"><code class="xref py py-class docutils literal notranslate"><span class="pre">ReadConcern</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/write_concern.html#pymongo.write_concern.WriteConcern" title="pymongo.write_concern.WriteConcern"><code class="xref py py-class docutils literal notranslate"><span class="pre">WriteConcern</span></code></a> is now applied to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_replace" title="pymongo.collection.Collection.find_one_and_replace"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_replace()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_update" title="pymongo.collection.Collection.find_one_and_update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_update()</span></code></a>, and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_delete" title="pymongo.collection.Collection.find_one_and_delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_delete()</span></code></a>.</li>
<li>Support for the new <cite>bypassDocumentValidation</cite> option in write
helpers.</li>
</ul>
</li>
<li>Support for reading and writing raw BSON with
<a class="reference internal" href="api/bson/raw_bson.html#bson.raw_bson.RawBSONDocument" title="bson.raw_bson.RawBSONDocument"><code class="xref py py-class docutils literal notranslate"><span class="pre">RawBSONDocument</span></code></a></li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Certain <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> properties now
block until a connection is established or raise
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ServerSelectionTimeoutError" title="pymongo.errors.ServerSelectionTimeoutError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ServerSelectionTimeoutError</span></code></a> if no server is available.
See <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> for details.</p>
</div>
<div class="section" id="id12">
<h3>Issues Resolved<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=15612">PyMongo 3.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-1-1">
<h2>Changes in Version 3.1.1<a class="headerlink" href="#changes-in-version-3-1-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.1.1 fixes a few issues reported since the release of 3.1, including a
regression in error handling for oversize command documents and interrupt
handling issues in the C extensions.</p>
<div class="section" id="id13">
<h3>Issues Resolved<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16211">PyMongo 3.1.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-1">
<h2>Changes in Version 3.1<a class="headerlink" href="#changes-in-version-3-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.1 implements a few new features and fixes bugs reported since the release
of 3.0.3.</p>
<p>Highlights include:</p>
<ul class="simple">
<li>Command monitoring support. See <a class="reference internal" href="api/pymongo/monitoring.html#module-pymongo.monitoring" title="pymongo.monitoring: Tools for monitoring driver events."><code class="xref py py-mod docutils literal notranslate"><span class="pre">monitoring</span></code></a> for details.</li>
<li>Configurable error handling for <code class="xref py py-exc docutils literal notranslate"><span class="pre">UnicodeDecodeError</span></code>. See the
<cite>unicode_decode_error_handler</cite> option of
<a class="reference internal" href="api/bson/codec_options.html#bson.codec_options.CodecOptions" title="bson.codec_options.CodecOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">CodecOptions</span></code></a>.</li>
<li>Optional automatic timezone conversion when decoding BSON datetime. See the
<cite>tzinfo</cite> option of <a class="reference internal" href="api/bson/codec_options.html#bson.codec_options.CodecOptions" title="bson.codec_options.CodecOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">CodecOptions</span></code></a>.</li>
<li>An implementation of <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFSBucket" title="gridfs.GridFSBucket"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridFSBucket</span></code></a> from the new GridFS spec.</li>
<li>Compliance with the new Connection String spec.</li>
<li>Reduced idle CPU usage in Python 2.</li>
</ul>
<div class="section" id="changes-in-internal-classes">
<h3>Changes in internal classes<a class="headerlink" href="#changes-in-internal-classes" title="Permalink to this headline">¶</a></h3>
<p>The private <code class="docutils literal notranslate"><span class="pre">PeriodicExecutor</span></code> class no longer takes a <code class="docutils literal notranslate"><span class="pre">condition_class</span></code>
option, and the private <code class="docutils literal notranslate"><span class="pre">thread_util.Event</span></code> class is removed.</p>
</div>
<div class="section" id="id14">
<h3>Issues Resolved<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=14796">PyMongo 3.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-0-3">
<h2>Changes in Version 3.0.3<a class="headerlink" href="#changes-in-version-3-0-3" title="Permalink to this headline">¶</a></h2>
<p>Version 3.0.3 fixes issues reported since the release of 3.0.2, including a
feature breaking bug in the GSSAPI implementation.</p>
<div class="section" id="id15">
<h3>Issues Resolved<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=15528">PyMongo 3.0.3 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-0-2">
<h2>Changes in Version 3.0.2<a class="headerlink" href="#changes-in-version-3-0-2" title="Permalink to this headline">¶</a></h2>
<p>Version 3.0.2 fixes issues reported since the release of 3.0.1, most
importantly a bug that could route operations to replica set members
that are not in primary or secondary state when using
<a class="reference internal" href="api/pymongo/read_preferences.html#pymongo.read_preferences.PrimaryPreferred" title="pymongo.read_preferences.PrimaryPreferred"><code class="xref py py-class docutils literal notranslate"><span class="pre">PrimaryPreferred</span></code></a> or
<a class="reference internal" href="api/pymongo/read_preferences.html#pymongo.read_preferences.Nearest" title="pymongo.read_preferences.Nearest"><code class="xref py py-class docutils literal notranslate"><span class="pre">Nearest</span></code></a>. It is a recommended upgrade for
all users of PyMongo 3.0.x.</p>
<div class="section" id="id16">
<h3>Issues Resolved<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=15430">PyMongo 3.0.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-0-1">
<h2>Changes in Version 3.0.1<a class="headerlink" href="#changes-in-version-3-0-1" title="Permalink to this headline">¶</a></h2>
<p>Version 3.0.1 fixes issues reported since the release of 3.0, most
importantly a bug in GridFS.delete that could prevent file chunks from
actually being deleted.</p>
<div class="section" id="id17">
<h3>Issues Resolved<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=15322">PyMongo 3.0.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-3-0">
<h2>Changes in Version 3.0<a class="headerlink" href="#changes-in-version-3-0" title="Permalink to this headline">¶</a></h2>
<p>PyMongo 3.0 is a partial rewrite of PyMongo bringing a large number of
improvements:</p>
<ul class="simple">
<li>A unified client class. MongoClient is the one and only client class for
connecting to a standalone mongod, replica set, or sharded cluster. Migrating
from a standalone, to a replica set, to a sharded cluster can be accomplished
with only a simple URI change.</li>
<li>MongoClient is much more responsive to configuration changes in your MongoDB
deployment. All connected servers are monitored in a non-blocking manner.
Slow to respond or down servers no longer block server discovery, reducing
application startup time and time to respond to new or reconfigured
servers and replica set failovers.</li>
<li>A unified CRUD API. All official MongoDB drivers now implement a standard
CRUD API allowing polyglot developers to move from language to language
with ease.</li>
<li>Single source support for Python 2.x and 3.x. PyMongo no longer relies on
2to3 to support Python 3.</li>
<li>A rewritten pure Python BSON implementation, improving performance
with pypy and cpython deployments without support for C extensions.</li>
<li>Better support for greenlet based async frameworks including eventlet.</li>
<li>Immutable client, database, and collection classes, avoiding a host of thread
safety issues in client applications.</li>
</ul>
<p>PyMongo 3.0 brings a large number of API changes. Be sure to read the changes
listed below before upgrading from PyMongo 2.x.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">PyMongo no longer supports Python 2.4, 2.5, or 3.1. If you
must use PyMongo with these versions of Python the 2.x branch of PyMongo
will be minimally supported for some time.</p>
</div>
<div class="section" id="sonmanipulator-changes">
<h3>SONManipulator changes<a class="headerlink" href="#sonmanipulator-changes" title="Permalink to this headline">¶</a></h3>
<p>The <a class="reference internal" href="api/pymongo/son_manipulator.html#pymongo.son_manipulator.SONManipulator" title="pymongo.son_manipulator.SONManipulator"><code class="xref py py-class docutils literal notranslate"><span class="pre">SONManipulator</span></code></a> API has limitations as a
technique for transforming your data. Instead, it is more flexible and
straightforward to transform outgoing documents in your own code before passing
them to PyMongo, and transform incoming documents after receiving them from
PyMongo.</p>
<p>Thus the <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.add_son_manipulator" title="pymongo.database.Database.add_son_manipulator"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_son_manipulator()</span></code></a> method is
deprecated. PyMongo 3’s new CRUD API does <strong>not</strong> apply SON manipulators to
documents passed to <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.bulk_write" title="pymongo.collection.Collection.bulk_write"><code class="xref py py-meth docutils literal notranslate"><span class="pre">bulk_write()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert_one" title="pymongo.collection.Collection.insert_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert_one()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert_many" title="pymongo.collection.Collection.insert_many"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert_many()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_one" title="pymongo.collection.Collection.update_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_one()</span></code></a>, or
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_many" title="pymongo.collection.Collection.update_many"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_many()</span></code></a>. SON manipulators are <strong>not</strong>
applied to documents returned by the new methods
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_delete" title="pymongo.collection.Collection.find_one_and_delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_delete()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_replace" title="pymongo.collection.Collection.find_one_and_replace"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_replace()</span></code></a>, and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_update" title="pymongo.collection.Collection.find_one_and_update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_update()</span></code></a>.</p>
</div>
<div class="section" id="ssl-tls-changes">
<h3>SSL/TLS changes<a class="headerlink" href="#ssl-tls-changes" title="Permalink to this headline">¶</a></h3>
<p>When <cite>ssl</cite> is <code class="docutils literal notranslate"><span class="pre">True</span></code> the <cite>ssl_cert_reqs</cite> option now defaults to
<code class="xref py py-attr docutils literal notranslate"><span class="pre">ssl.CERT_REQUIRED</span></code> if not provided. PyMongo will attempt to load OS
provided CA certificates to verify the server, raising
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConfigurationError" title="pymongo.errors.ConfigurationError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ConfigurationError</span></code></a> if it cannot.</p>
</div>
<div class="section" id="gevent-support">
<h3>Gevent Support<a class="headerlink" href="#gevent-support" title="Permalink to this headline">¶</a></h3>
<p>In previous versions, PyMongo supported Gevent in two modes: you could call
<code class="docutils literal notranslate"><span class="pre">gevent.monkey.patch_socket()</span></code> and pass <code class="docutils literal notranslate"><span class="pre">use_greenlets=True</span></code> to
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a>, or you could simply call
<code class="docutils literal notranslate"><span class="pre">gevent.monkey.patch_all()</span></code> and omit the <code class="docutils literal notranslate"><span class="pre">use_greenlets</span></code> argument.</p>
<p>In PyMongo 3.0, the <code class="docutils literal notranslate"><span class="pre">use_greenlets</span></code> option is gone. To use PyMongo with
Gevent simply call <code class="docutils literal notranslate"><span class="pre">gevent.monkey.patch_all()</span></code>.</p>
<p>For more information,
see <a class="reference internal" href="examples/gevent.html"><span class="doc">PyMongo’s Gevent documentation</span></a>.</p>
</div>
<div class="section" id="mongoclient-changes">
<h3><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> changes<a class="headerlink" href="#mongoclient-changes" title="Permalink to this headline">¶</a></h3>
<p><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> is now the one and only
client class for a standalone server, mongos, or replica set.
It includes the functionality that had been split into
<code class="docutils literal notranslate"><span class="pre">MongoReplicaSetClient</span></code>: it can connect to a replica set, discover all its
members, and monitor the set for stepdowns, elections, and reconfigs.
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> now also supports the full
<a class="reference internal" href="api/pymongo/read_preferences.html#pymongo.read_preferences.ReadPreference" title="pymongo.read_preferences.ReadPreference"><code class="xref py py-class docutils literal notranslate"><span class="pre">ReadPreference</span></code></a> API.</p>
<p>The obsolete classes <code class="docutils literal notranslate"><span class="pre">MasterSlaveConnection</span></code>, <code class="docutils literal notranslate"><span class="pre">Connection</span></code>, and
<code class="docutils literal notranslate"><span class="pre">ReplicaSetConnection</span></code> are removed.</p>
<p>The <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> constructor no
longer blocks while connecting to the server or servers, and it no
longer raises <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConnectionFailure" title="pymongo.errors.ConnectionFailure"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConnectionFailure</span></code></a> if they
are unavailable, nor <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConfigurationError" title="pymongo.errors.ConfigurationError"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConfigurationError</span></code></a>
if the user’s credentials are wrong. Instead, the constructor
returns immediately and launches the connection process on
background threads. The <code class="docutils literal notranslate"><span class="pre">connect</span></code> option is added to control whether
these threads are started immediately, or when the client is first used.</p>
<p>Therefore the <code class="docutils literal notranslate"><span class="pre">alive</span></code> method is removed since it no longer provides meaningful
information; even if the client is disconnected, it may discover a server in
time to fulfill the next operation.</p>
<p>In PyMongo 2.x, <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> accepted a list of
standalone MongoDB servers and used the first it could connect to:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">MongoClient</span><span class="p">([</span><span class="s1">&#39;host1.com:27017&#39;</span><span class="p">,</span> <span class="s1">&#39;host2.com:27017&#39;</span><span class="p">])</span>
</pre></div>
</div>
<p>A list of multiple standalones is no longer supported; if multiple servers
are listed they must be members of the same replica set, or mongoses in the
same sharded cluster.</p>
<p>The behavior for a list of mongoses is changed from “high availability” to
“load balancing”. Before, the client connected to the lowest-latency mongos in
the list, and used it until a network error prompted it to re-evaluate all
mongoses’ latencies and reconnect to one of them. In PyMongo 3, the client
monitors its network latency to all the mongoses continuously, and distributes
operations evenly among those with the lowest latency.
See <a class="reference internal" href="examples/high_availability.html#mongos-load-balancing"><span class="std std-ref">mongos Load Balancing</span></a> for more information.</p>
<p>The client methods <code class="docutils literal notranslate"><span class="pre">start_request</span></code>, <code class="docutils literal notranslate"><span class="pre">in_request</span></code>, and <code class="docutils literal notranslate"><span class="pre">end_request</span></code>
are removed, and so is the <code class="docutils literal notranslate"><span class="pre">auto_start_request</span></code> option. Requests were
designed to make read-your-writes consistency more likely with the <code class="docutils literal notranslate"><span class="pre">w=0</span></code>
write concern. Additionally, a thread in a request used the same member for
all secondary reads in a replica set. To ensure read-your-writes consistency
in PyMongo 3.0, do not override the default write concern with <code class="docutils literal notranslate"><span class="pre">w=0</span></code>, and
do not override the default <a class="reference internal" href="examples/high_availability.html#secondary-reads"><span class="std std-ref">read preference</span></a> of
PRIMARY.</p>
<p>Support for the <code class="docutils literal notranslate"><span class="pre">slaveOk</span></code> (or <code class="docutils literal notranslate"><span class="pre">slave_okay</span></code>), <code class="docutils literal notranslate"><span class="pre">safe</span></code>, and
<code class="docutils literal notranslate"><span class="pre">network_timeout</span></code> options has been removed. Use
<a class="reference internal" href="api/pymongo/read_preferences.html#pymongo.read_preferences.ReadPreference.SECONDARY_PREFERRED" title="pymongo.read_preferences.ReadPreference.SECONDARY_PREFERRED"><code class="xref py py-attr docutils literal notranslate"><span class="pre">SECONDARY_PREFERRED</span></code></a> instead of
slave_okay. Accept the default write concern, acknowledged writes, instead of
setting safe=True. Use socketTimeoutMS in place of network_timeout (note that
network_timeout was in seconds, where as socketTimeoutMS is milliseconds).</p>
<p>The <code class="docutils literal notranslate"><span class="pre">max_pool_size</span></code> option has been removed. It is replaced by the
<code class="docutils literal notranslate"><span class="pre">maxPoolSize</span></code> MongoDB URI option. <code class="docutils literal notranslate"><span class="pre">maxPoolSize</span></code> is now a supported URI
option in PyMongo and can be passed as a keyword argument.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">copy_database</span></code> method is removed, see the
<a class="reference internal" href="examples/copydb.html"><span class="doc">copy_database examples</span></a> for alternatives.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">disconnect</span></code> method is removed. Use
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.close" title="pymongo.mongo_client.MongoClient.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">close()</span></code></a> instead.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">get_document_class</span></code> method is removed. Use
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.codec_options" title="pymongo.mongo_client.MongoClient.codec_options"><code class="xref py py-attr docutils literal notranslate"><span class="pre">codec_options</span></code></a> instead.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">get_lasterror_options</span></code>, <code class="docutils literal notranslate"><span class="pre">set_lasterror_options</span></code>, and
<code class="docutils literal notranslate"><span class="pre">unset_lasterror_options</span></code> methods are removed. Write concern options
can be passed to <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> as keyword
arguments or MongoDB URI options.</p>
<p>The <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.get_database" title="pymongo.mongo_client.MongoClient.get_database"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_database()</span></code></a> method is added for
getting a Database instance with its options configured differently than the
MongoClient’s.</p>
<p>The following read-only attributes have been added:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.codec_options" title="pymongo.mongo_client.MongoClient.codec_options"><code class="xref py py-attr docutils literal notranslate"><span class="pre">codec_options</span></code></a></li>
</ul>
<p>The following attributes are now read-only:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.read_preference" title="pymongo.mongo_client.MongoClient.read_preference"><code class="xref py py-attr docutils literal notranslate"><span class="pre">read_preference</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.write_concern" title="pymongo.mongo_client.MongoClient.write_concern"><code class="xref py py-attr docutils literal notranslate"><span class="pre">write_concern</span></code></a></li>
</ul>
<p>The following attributes have been removed:</p>
<ul class="simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">document_class</span></code>
(use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.codec_options" title="pymongo.mongo_client.MongoClient.codec_options"><code class="xref py py-attr docutils literal notranslate"><span class="pre">codec_options</span></code></a> instead)</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">host</span></code>
(use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.address" title="pymongo.mongo_client.MongoClient.address"><code class="xref py py-attr docutils literal notranslate"><span class="pre">address</span></code></a> instead)</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">min_wire_version</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">max_wire_version</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">port</span></code>
(use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.address" title="pymongo.mongo_client.MongoClient.address"><code class="xref py py-attr docutils literal notranslate"><span class="pre">address</span></code></a> instead)</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">safe</span></code>
(use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.write_concern" title="pymongo.mongo_client.MongoClient.write_concern"><code class="xref py py-attr docutils literal notranslate"><span class="pre">write_concern</span></code></a> instead)</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">slave_okay</span></code>
(use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.read_preference" title="pymongo.mongo_client.MongoClient.read_preference"><code class="xref py py-attr docutils literal notranslate"><span class="pre">read_preference</span></code></a> instead)</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tag_sets</span></code>
(use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.read_preference" title="pymongo.mongo_client.MongoClient.read_preference"><code class="xref py py-attr docutils literal notranslate"><span class="pre">read_preference</span></code></a> instead)</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tz_aware</span></code>
(use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.codec_options" title="pymongo.mongo_client.MongoClient.codec_options"><code class="xref py py-attr docutils literal notranslate"><span class="pre">codec_options</span></code></a> instead)</li>
</ul>
<p>The following attributes have been renamed:</p>
<ul class="simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">secondary_acceptable_latency_ms</span></code> is
now <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.local_threshold_ms" title="pymongo.mongo_client.MongoClient.local_threshold_ms"><code class="xref py py-attr docutils literal notranslate"><span class="pre">local_threshold_ms</span></code></a> and is now
read-only.</li>
</ul>
</div>
<div class="section" id="cursor-changes">
<h3><a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor" title="pymongo.cursor.Cursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">Cursor</span></code></a> changes<a class="headerlink" href="#cursor-changes" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal notranslate"><span class="pre">conn_id</span></code> property is renamed to <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.address" title="pymongo.cursor.Cursor.address"><code class="xref py py-attr docutils literal notranslate"><span class="pre">address</span></code></a>.</p>
</div>
<div class="section" id="cursor-management-changes">
<h3>Cursor management changes<a class="headerlink" href="#cursor-management-changes" title="Permalink to this headline">¶</a></h3>
<p><a class="reference internal" href="api/pymongo/cursor_manager.html#pymongo.cursor_manager.CursorManager" title="pymongo.cursor_manager.CursorManager"><code class="xref py py-class docutils literal notranslate"><span class="pre">CursorManager</span></code></a> and
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.set_cursor_manager" title="pymongo.mongo_client.MongoClient.set_cursor_manager"><code class="xref py py-meth docutils literal notranslate"><span class="pre">set_cursor_manager()</span></code></a> are no longer
deprecated. If you subclass <a class="reference internal" href="api/pymongo/cursor_manager.html#pymongo.cursor_manager.CursorManager" title="pymongo.cursor_manager.CursorManager"><code class="xref py py-class docutils literal notranslate"><span class="pre">CursorManager</span></code></a>
your implementation of <a class="reference internal" href="api/pymongo/cursor_manager.html#pymongo.cursor_manager.CursorManager.close" title="pymongo.cursor_manager.CursorManager.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">close()</span></code></a>
must now take a second parameter, <cite>address</cite>. The <code class="docutils literal notranslate"><span class="pre">BatchCursorManager</span></code> class
is removed.</p>
<p>The second parameter to <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.close_cursor" title="pymongo.mongo_client.MongoClient.close_cursor"><code class="xref py py-meth docutils literal notranslate"><span class="pre">close_cursor()</span></code></a>
is renamed from <code class="docutils literal notranslate"><span class="pre">_conn_id</span></code> to <code class="docutils literal notranslate"><span class="pre">address</span></code>.
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.kill_cursors" title="pymongo.mongo_client.MongoClient.kill_cursors"><code class="xref py py-meth docutils literal notranslate"><span class="pre">kill_cursors()</span></code></a> now accepts an <cite>address</cite>
parameter.</p>
</div>
<div class="section" id="database-changes">
<h3><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database" title="pymongo.database.Database"><code class="xref py py-class docutils literal notranslate"><span class="pre">Database</span></code></a> changes<a class="headerlink" href="#database-changes" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal notranslate"><span class="pre">connection</span></code> property is renamed to
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.client" title="pymongo.database.Database.client"><code class="xref py py-attr docutils literal notranslate"><span class="pre">client</span></code></a>.</p>
<p>The following read-only attributes have been added:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.codec_options" title="pymongo.database.Database.codec_options"><code class="xref py py-attr docutils literal notranslate"><span class="pre">codec_options</span></code></a></li>
</ul>
<p>The following attributes are now read-only:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.read_preference" title="pymongo.database.Database.read_preference"><code class="xref py py-attr docutils literal notranslate"><span class="pre">read_preference</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.write_concern" title="pymongo.database.Database.write_concern"><code class="xref py py-attr docutils literal notranslate"><span class="pre">write_concern</span></code></a></li>
</ul>
<p>Use <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.get_database" title="pymongo.mongo_client.MongoClient.get_database"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_database()</span></code></a> for getting a
Database instance with its options configured differently than the
MongoClient’s.</p>
<p>The following attributes have been removed:</p>
<ul class="simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">safe</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">secondary_acceptable_latency_ms</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">slave_okay</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tag_sets</span></code></li>
</ul>
<p>The following methods have been added:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.get_collection" title="pymongo.database.Database.get_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_collection()</span></code></a></li>
</ul>
<p>The following methods have been changed:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.command" title="pymongo.database.Database.command"><code class="xref py py-meth docutils literal notranslate"><span class="pre">command()</span></code></a>. Support for <cite>as_class</cite>,
<cite>uuid_subtype</cite>, <cite>tag_sets</cite>, and <cite>secondary_acceptable_latency_ms</cite> have been
removed. You can instead pass an instance of
<a class="reference internal" href="api/bson/codec_options.html#bson.codec_options.CodecOptions" title="bson.codec_options.CodecOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">CodecOptions</span></code></a> as <cite>codec_options</cite> and an instance
of a read preference class from <a class="reference internal" href="api/pymongo/read_preferences.html#module-pymongo.read_preferences" title="pymongo.read_preferences: Utilities for choosing which member of a replica set to read from."><code class="xref py py-mod docutils literal notranslate"><span class="pre">read_preferences</span></code></a> as
<cite>read_preference</cite>. The <cite>fields</cite> and <cite>compile_re</cite> options are also removed.
The <cite>fields</cite> options was undocumented and never really worked. Regular
expressions are always decoded to <a class="reference internal" href="api/bson/regex.html#bson.regex.Regex" title="bson.regex.Regex"><code class="xref py py-class docutils literal notranslate"><span class="pre">Regex</span></code></a>.</li>
</ul>
<p>The following methods have been deprecated:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.add_son_manipulator" title="pymongo.database.Database.add_son_manipulator"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_son_manipulator()</span></code></a></li>
</ul>
<p>The following methods have been removed:</p>
<p>The <code class="docutils literal notranslate"><span class="pre">get_lasterror_options</span></code>, <code class="docutils literal notranslate"><span class="pre">set_lasterror_options</span></code>, and
<code class="docutils literal notranslate"><span class="pre">unset_lasterror_options</span></code> methods have been removed. Use
<a class="reference internal" href="api/pymongo/write_concern.html#pymongo.write_concern.WriteConcern" title="pymongo.write_concern.WriteConcern"><code class="xref py py-class docutils literal notranslate"><span class="pre">WriteConcern</span></code></a> with
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.get_database" title="pymongo.mongo_client.MongoClient.get_database"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_database()</span></code></a> instead.</p>
</div>
<div class="section" id="collection-changes">
<h3><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a> changes<a class="headerlink" href="#collection-changes" title="Permalink to this headline">¶</a></h3>
<p>The following read-only attributes have been added:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.codec_options" title="pymongo.collection.Collection.codec_options"><code class="xref py py-attr docutils literal notranslate"><span class="pre">codec_options</span></code></a></li>
</ul>
<p>The following attributes are now read-only:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.read_preference" title="pymongo.collection.Collection.read_preference"><code class="xref py py-attr docutils literal notranslate"><span class="pre">read_preference</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.write_concern" title="pymongo.collection.Collection.write_concern"><code class="xref py py-attr docutils literal notranslate"><span class="pre">write_concern</span></code></a></li>
</ul>
<p>Use <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.get_collection" title="pymongo.database.Database.get_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_collection()</span></code></a> or
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a> for getting a Collection
instance with its options configured differently than the Database’s.</p>
<p>The following attributes have been removed:</p>
<ul class="simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">safe</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">secondary_acceptable_latency_ms</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">slave_okay</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tag_sets</span></code></li>
</ul>
<p>The following methods have been added:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.bulk_write" title="pymongo.collection.Collection.bulk_write"><code class="xref py py-meth docutils literal notranslate"><span class="pre">bulk_write()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert_one" title="pymongo.collection.Collection.insert_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert_one()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert_many" title="pymongo.collection.Collection.insert_many"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert_many()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_one" title="pymongo.collection.Collection.update_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_one()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update_many" title="pymongo.collection.Collection.update_many"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_many()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.replace_one" title="pymongo.collection.Collection.replace_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">replace_one()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.delete_one" title="pymongo.collection.Collection.delete_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">delete_one()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.delete_many" title="pymongo.collection.Collection.delete_many"><code class="xref py py-meth docutils literal notranslate"><span class="pre">delete_many()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_delete" title="pymongo.collection.Collection.find_one_and_delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_delete()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_replace" title="pymongo.collection.Collection.find_one_and_replace"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_replace()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_update" title="pymongo.collection.Collection.find_one_and_update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one_and_update()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_indexes" title="pymongo.collection.Collection.create_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_indexes()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.list_indexes" title="pymongo.collection.Collection.list_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list_indexes()</span></code></a></li>
</ul>
<p>The following methods have changed:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a> now <strong>always</strong> returns an
instance of <a class="reference internal" href="api/pymongo/command_cursor.html#pymongo.command_cursor.CommandCursor" title="pymongo.command_cursor.CommandCursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">CommandCursor</span></code></a>. See the
documentation for all options.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.count" title="pymongo.collection.Collection.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">count()</span></code></a> now optionally takes a filter
argument, as well as other options supported by the count command.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.distinct" title="pymongo.collection.Collection.distinct"><code class="xref py py-meth docutils literal notranslate"><span class="pre">distinct()</span></code></a> now optionally takes a filter
argument.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_index" title="pymongo.collection.Collection.create_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_index()</span></code></a> no longer caches
indexes, therefore the <cite>cache_for</cite> parameter has been removed. It also
no longer supports the <cite>bucket_size</cite> and <cite>drop_dups</cite> aliases for <cite>bucketSize</cite>
and <cite>dropDups</cite>.</li>
</ul>
<p>The following methods are deprecated:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.save" title="pymongo.collection.Collection.save"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update" title="pymongo.collection.Collection.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.remove" title="pymongo.collection.Collection.remove"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_and_modify" title="pymongo.collection.Collection.find_and_modify"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_and_modify()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.ensure_index" title="pymongo.collection.Collection.ensure_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ensure_index()</span></code></a></li>
</ul>
<p>The following methods have been removed:</p>
<p>The <code class="docutils literal notranslate"><span class="pre">get_lasterror_options</span></code>, <code class="docutils literal notranslate"><span class="pre">set_lasterror_options</span></code>, and
<code class="docutils literal notranslate"><span class="pre">unset_lasterror_options</span></code> methods have been removed. Use
<a class="reference internal" href="api/pymongo/write_concern.html#pymongo.write_concern.WriteConcern" title="pymongo.write_concern.WriteConcern"><code class="xref py py-class docutils literal notranslate"><span class="pre">WriteConcern</span></code></a> with
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a> instead.</p>
<div class="section" id="changes-to-find-and-find-one">
<h4>Changes to <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a> and <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one" title="pymongo.collection.Collection.find_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one()</span></code></a><a class="headerlink" href="#changes-to-find-and-find-one" title="Permalink to this headline">¶</a></h4>
<p>The following find/find_one options have been renamed:</p>
<p>These renames only affect your code if you passed these as keyword arguments,
like find(fields=[‘fieldname’]). If you passed only positional parameters these
changes are not significant for your application.</p>
<ul class="simple">
<li>spec -&gt; filter</li>
<li>fields -&gt; projection</li>
<li>partial -&gt; allow_partial_results</li>
</ul>
<p>The following find/find_one options have been added:</p>
<ul class="simple">
<li>cursor_type (see <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.CursorType" title="pymongo.cursor.CursorType"><code class="xref py py-class docutils literal notranslate"><span class="pre">CursorType</span></code></a> for values)</li>
<li>oplog_replay</li>
<li>modifiers</li>
</ul>
<p>The following find/find_one options have been removed:</p>
<ul class="simple">
<li>network_timeout (use <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.max_time_ms" title="pymongo.cursor.Cursor.max_time_ms"><code class="xref py py-meth docutils literal notranslate"><span class="pre">max_time_ms()</span></code></a> instead)</li>
<li>slave_okay (use one of the read preference classes from
<a class="reference internal" href="api/pymongo/read_preferences.html#module-pymongo.read_preferences" title="pymongo.read_preferences: Utilities for choosing which member of a replica set to read from."><code class="xref py py-mod docutils literal notranslate"><span class="pre">read_preferences</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a> instead)</li>
<li>read_preference (use <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a>
instead)</li>
<li>tag_sets (use one of the read preference classes from
<a class="reference internal" href="api/pymongo/read_preferences.html#module-pymongo.read_preferences" title="pymongo.read_preferences: Utilities for choosing which member of a replica set to read from."><code class="xref py py-mod docutils literal notranslate"><span class="pre">read_preferences</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a> instead)</li>
<li>secondary_acceptable_latency_ms (use the <cite>localThresholdMS</cite> URI option
instead)</li>
<li>max_scan (use the new <cite>modifiers</cite> option instead)</li>
<li>snapshot (use the new <cite>modifiers</cite> option instead)</li>
<li>tailable (use the new <cite>cursor_type</cite> option instead)</li>
<li>await_data (use the new <cite>cursor_type</cite> option instead)</li>
<li>exhaust (use the new <cite>cursor_type</cite> option instead)</li>
<li>as_class (use <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a> with
<a class="reference internal" href="api/bson/codec_options.html#bson.codec_options.CodecOptions" title="bson.codec_options.CodecOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">CodecOptions</span></code></a> instead)</li>
<li>compile_re (BSON regular expressions are always decoded to
<a class="reference internal" href="api/bson/regex.html#bson.regex.Regex" title="bson.regex.Regex"><code class="xref py py-class docutils literal notranslate"><span class="pre">Regex</span></code></a>)</li>
</ul>
<p>The following find/find_one options are deprecated:</p>
<ul class="simple">
<li>manipulate</li>
</ul>
<p>The following renames need special handling.</p>
<ul class="simple">
<li>timeout -&gt; no_cursor_timeout -
The default for <cite>timeout</cite> was True. The default for <cite>no_cursor_timeout</cite> is
False. If you were previously passing False for <cite>timeout</cite> you must pass
<strong>True</strong> for <cite>no_cursor_timeout</cite> to keep the previous behavior.</li>
</ul>
</div>
</div>
<div class="section" id="errors-changes">
<h3><a class="reference internal" href="api/pymongo/errors.html#module-pymongo.errors" title="pymongo.errors: Exceptions raised by the pymongo package"><code class="xref py py-mod docutils literal notranslate"><span class="pre">errors</span></code></a> changes<a class="headerlink" href="#errors-changes" title="Permalink to this headline">¶</a></h3>
<p>The exception classes <code class="docutils literal notranslate"><span class="pre">UnsupportedOption</span></code> and <code class="docutils literal notranslate"><span class="pre">TimeoutError</span></code> are deleted.</p>
</div>
<div class="section" id="gridfs-changes">
<h3><a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a> changes<a class="headerlink" href="#gridfs-changes" title="Permalink to this headline">¶</a></h3>
<p>Since PyMongo 1.6, methods <code class="docutils literal notranslate"><span class="pre">open</span></code> and <code class="docutils literal notranslate"><span class="pre">close</span></code> of <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS" title="gridfs.GridFS"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridFS</span></code></a>
raised an <code class="docutils literal notranslate"><span class="pre">UnsupportedAPI</span></code> exception, as did the entire <code class="docutils literal notranslate"><span class="pre">GridFile</span></code> class.
The unsupported methods, the class, and the exception are all deleted.</p>
</div>
<div class="section" id="bson-changes">
<h3><a class="reference internal" href="api/bson/index.html#module-bson" title="bson: BSON (Binary JSON) Encoding and Decoding"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a> changes<a class="headerlink" href="#bson-changes" title="Permalink to this headline">¶</a></h3>
<p>The <cite>compile_re</cite> option is removed from all methods
that accepted it in <a class="reference internal" href="api/bson/index.html#module-bson" title="bson: BSON (Binary JSON) Encoding and Decoding"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a> and <a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">json_util</span></code></a>. Additionally, it
is removed from <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one" title="pymongo.collection.Collection.find_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a>,
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.command" title="pymongo.database.Database.command"><code class="xref py py-meth docutils literal notranslate"><span class="pre">command()</span></code></a>, and so on.
PyMongo now always represents BSON regular expressions as
<a class="reference internal" href="api/bson/regex.html#bson.regex.Regex" title="bson.regex.Regex"><code class="xref py py-class docutils literal notranslate"><span class="pre">Regex</span></code></a> objects. This prevents errors for incompatible
patterns, see <a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-500">PYTHON-500</a>. Use <a class="reference internal" href="api/bson/regex.html#bson.regex.Regex.try_compile" title="bson.regex.Regex.try_compile"><code class="xref py py-meth docutils literal notranslate"><span class="pre">try_compile()</span></code></a> to
attempt to convert from a BSON regular expression to a Python regular
expression object.</p>
<p>PyMongo now decodes the int64 BSON type to <a class="reference internal" href="api/bson/int64.html#bson.int64.Int64" title="bson.int64.Int64"><code class="xref py py-class docutils literal notranslate"><span class="pre">Int64</span></code></a>, a
trivial wrapper around long (in python 2.x) or int (in python 3.x). This
allows BSON int64 to be round tripped without losing type information in
python 3. Note that if you store a python long (or a python int larger than
4 bytes) it will be returned from PyMongo as <a class="reference internal" href="api/bson/int64.html#bson.int64.Int64" title="bson.int64.Int64"><code class="xref py py-class docutils literal notranslate"><span class="pre">Int64</span></code></a>.</p>
<p>The <cite>as_class</cite>, <cite>tz_aware</cite>, and <cite>uuid_subtype</cite> options are removed from all
BSON encoding and decoding methods. Use
<a class="reference internal" href="api/bson/codec_options.html#bson.codec_options.CodecOptions" title="bson.codec_options.CodecOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">CodecOptions</span></code></a> to configure these options. The
APIs affected are:</p>
<ul class="simple">
<li><a class="reference internal" href="api/bson/index.html#bson.decode_all" title="bson.decode_all"><code class="xref py py-func docutils literal notranslate"><span class="pre">decode_all()</span></code></a></li>
<li><a class="reference internal" href="api/bson/index.html#bson.decode_iter" title="bson.decode_iter"><code class="xref py py-func docutils literal notranslate"><span class="pre">decode_iter()</span></code></a></li>
<li><a class="reference internal" href="api/bson/index.html#bson.decode_file_iter" title="bson.decode_file_iter"><code class="xref py py-func docutils literal notranslate"><span class="pre">decode_file_iter()</span></code></a></li>
<li><a class="reference internal" href="api/bson/index.html#bson.BSON.encode" title="bson.BSON.encode"><code class="xref py py-meth docutils literal notranslate"><span class="pre">encode()</span></code></a></li>
<li><a class="reference internal" href="api/bson/index.html#bson.BSON.decode" title="bson.BSON.decode"><code class="xref py py-meth docutils literal notranslate"><span class="pre">decode()</span></code></a></li>
</ul>
<p>This is a breaking change for any application that uses the BSON API directly
and changes any of the named parameter defaults. No changes are required for
applications that use the default values for these options. The behavior
remains the same.</p>
</div>
<div class="section" id="id18">
<h3>Issues Resolved<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12501">PyMongo 3.0 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-9-5">
<h2>Changes in Version 2.9.5<a class="headerlink" href="#changes-in-version-2-9-5" title="Permalink to this headline">¶</a></h2>
<p>Version 2.9.5 works around ssl module deprecations in Python 3.6, and expected
future ssl module deprecations. It also fixes bugs found since the release of
2.9.4.</p>
<ul class="simple">
<li>Use ssl.SSLContext and ssl.PROTOCOL_TLS_CLIENT when available.</li>
<li>Fixed a C extensions build issue when the interpreter was built with -std=c99</li>
<li>Fixed various build issues with MinGW32.</li>
<li>Fixed a write concern bug in <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.add_user" title="pymongo.database.Database.add_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_user()</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.remove_user" title="pymongo.database.Database.remove_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove_user()</span></code></a> when connected to MongoDB 3.2+</li>
<li>Fixed various test failures related to changes in gevent, MongoDB, and our CI
test environment.</li>
</ul>
<div class="section" id="id19">
<h3>Issues Resolved<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=17605">PyMongo 2.9.5 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-9-4">
<h2>Changes in Version 2.9.4<a class="headerlink" href="#changes-in-version-2-9-4" title="Permalink to this headline">¶</a></h2>
<p>Version 2.9.4 fixes issues reported since the release of 2.9.3.</p>
<ul class="simple">
<li>Fixed __repr__ for closed instances of <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a>.</li>
<li>Fixed <a class="reference internal" href="api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient" title="pymongo.mongo_replica_set_client.MongoReplicaSetClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoReplicaSetClient</span></code></a> handling of
uuidRepresentation.</li>
<li>Fixed building and testing the documentation with python 3.x.</li>
<li>New documentation for <a class="reference internal" href="examples/tls.html"><span class="doc">TLS/SSL and PyMongo</span></a> and <a class="reference internal" href="atlas.html"><span class="doc">Using PyMongo with MongoDB Atlas</span></a>.</li>
</ul>
<div class="section" id="id20">
<h3>Issues Resolved<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16885">PyMongo 2.9.4 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-9-3">
<h2>Changes in Version 2.9.3<a class="headerlink" href="#changes-in-version-2-9-3" title="Permalink to this headline">¶</a></h2>
<p>Version 2.9.3 fixes a few issues reported since the release of 2.9.2 including
thread safety issues in <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.ensure_index" title="pymongo.collection.Collection.ensure_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ensure_index()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_index" title="pymongo.collection.Collection.drop_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_index()</span></code></a>, and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_indexes" title="pymongo.collection.Collection.drop_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_indexes()</span></code></a>.</p>
<div class="section" id="id21">
<h3>Issues Resolved<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16539">PyMongo 2.9.3 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-9-2">
<h2>Changes in Version 2.9.2<a class="headerlink" href="#changes-in-version-2-9-2" title="Permalink to this headline">¶</a></h2>
<p>Version 2.9.2 restores Python 3.1 support, which was broken in PyMongo 2.8. It
improves an error message when decoding BSON as well as fixes a couple other
issues including <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a> ignoring
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.codec_options" title="pymongo.collection.Collection.codec_options"><code class="xref py py-attr docutils literal notranslate"><span class="pre">codec_options</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.command" title="pymongo.database.Database.command"><code class="xref py py-meth docutils literal notranslate"><span class="pre">command()</span></code></a> raising a superfluous
<cite>DeprecationWarning</cite>.</p>
<div class="section" id="id22">
<h3>Issues Resolved<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16303">PyMongo 2.9.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-9-1">
<h2>Changes in Version 2.9.1<a class="headerlink" href="#changes-in-version-2-9-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.9.1 fixes two interrupt handling issues in the C extensions and
adapts a test case for a behavior change in MongoDB 3.2.</p>
<div class="section" id="id23">
<h3>Issues Resolved<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=16208">PyMongo 2.9.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-9">
<h2>Changes in Version 2.9<a class="headerlink" href="#changes-in-version-2-9" title="Permalink to this headline">¶</a></h2>
<p>Version 2.9 provides an upgrade path to PyMongo 3.x. Most of the API changes
from PyMongo 3.0 have been backported in a backward compatible way, allowing
applications to be written against PyMongo &gt;= 2.9, rather then PyMongo 2.x or
PyMongo 3.x. See the <a class="reference internal" href="migrate-to-pymongo3.html"><span class="doc">PyMongo 3 Migration Guide</span></a> for detailed examples.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>There are a number of new deprecations in this release for features
that were removed in PyMongo 3.0.</p>
<dl class="last docutils">
<dt><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a>:</dt>
<dd><ul class="first last simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">host</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">port</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">use_greenlets</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">document_class</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tz_aware</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">secondary_acceptable_latency_ms</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tag_sets</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">uuid_subtype</span></code></li>
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">disconnect()</span></code></li>
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">alive()</span></code></li>
</ul>
</dd>
<dt><a class="reference internal" href="api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient" title="pymongo.mongo_replica_set_client.MongoReplicaSetClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoReplicaSetClient</span></code></a>:</dt>
<dd><ul class="first last simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">use_greenlets</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">document_class</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tz_aware</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">secondary_acceptable_latency_ms</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tag_sets</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">uuid_subtype</span></code></li>
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">alive()</span></code></li>
</ul>
</dd>
<dt><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database" title="pymongo.database.Database"><code class="xref py py-class docutils literal notranslate"><span class="pre">Database</span></code></a>:</dt>
<dd><ul class="first last simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">secondary_acceptable_latency_ms</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tag_sets</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">uuid_subtype</span></code></li>
</ul>
</dd>
<dt><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a>:</dt>
<dd><ul class="first last simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">secondary_acceptable_latency_ms</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">tag_sets</span></code></li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">uuid_subtype</span></code></li>
</ul>
</dd>
</dl>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>In previous versions of PyMongo, changing the value of
<code class="xref py py-attr docutils literal notranslate"><span class="pre">document_class</span></code> changed
the behavior of all existing instances of
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">coll</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">test</span><span class="o">.</span><span class="n">test</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coll</span><span class="o">.</span><span class="n">find_one</span><span class="p">()</span>
<span class="go">{u&#39;_id&#39;: ObjectId(&#39;5579dc7cfba5220cc14d9a18&#39;)}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">bson.son</span> <span class="k">import</span> <span class="n">SON</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">client</span><span class="o">.</span><span class="n">document_class</span> <span class="o">=</span> <span class="n">SON</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coll</span><span class="o">.</span><span class="n">find_one</span><span class="p">()</span>
<span class="go">SON([(u&#39;_id&#39;, ObjectId(&#39;5579dc7cfba5220cc14d9a18&#39;))])</span>
</pre></div>
</div>
<p>The document_class setting is now configurable at the client,
database, collection, and per-operation level. This required breaking
the existing behavior. To change the document class per operation in a
forward compatible way use
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.with_options" title="pymongo.collection.Collection.with_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">with_options()</span></code></a>:</p>
<div class="last highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">coll</span><span class="o">.</span><span class="n">find_one</span><span class="p">()</span>
<span class="go">{u&#39;_id&#39;: ObjectId(&#39;5579dc7cfba5220cc14d9a18&#39;)}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">bson.codec_options</span> <span class="k">import</span> <span class="n">CodecOptions</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coll</span><span class="o">.</span><span class="n">with_options</span><span class="p">(</span><span class="n">CodecOptions</span><span class="p">(</span><span class="n">SON</span><span class="p">))</span><span class="o">.</span><span class="n">find_one</span><span class="p">()</span>
<span class="go">SON([(u&#39;_id&#39;, ObjectId(&#39;5579dc7cfba5220cc14d9a18&#39;))])</span>
</pre></div>
</div>
</div>
<div class="section" id="id24">
<h3>Issues Resolved<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=14795">PyMongo 2.9 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-8-1">
<h2>Changes in Version 2.8.1<a class="headerlink" href="#changes-in-version-2-8-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.8.1 fixes a number of issues reported since the release of PyMongo
2.8. It is a recommended upgrade for all users of PyMongo 2.x.</p>
<div class="section" id="id25">
<h3>Issues Resolved<a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=15324">PyMongo 2.8.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-8">
<h2>Changes in Version 2.8<a class="headerlink" href="#changes-in-version-2-8" title="Permalink to this headline">¶</a></h2>
<p>Version 2.8 is a major release that provides full support for MongoDB 3.0 and
fixes a number of bugs.</p>
<p>Special thanks to Don Mitchell, Ximing, Can Zhang, Sergey Azovskov, and Heewa
Barfchin for their contributions to this release.</p>
<p>Highlights include:</p>
<ul class="simple">
<li>Support for the SCRAM-SHA-1 authentication mechanism (new in MongoDB 3.0).</li>
<li>JSON decoder support for the new $numberLong and $undefined types.</li>
<li>JSON decoder support for the $date type as an ISO-8601 string.</li>
<li>Support passing an index name to <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.hint" title="pymongo.cursor.Cursor.hint"><code class="xref py py-meth docutils literal notranslate"><span class="pre">hint()</span></code></a>.</li>
<li>The <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.count" title="pymongo.cursor.Cursor.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">count()</span></code></a> method will use a hint if one
has been provided through <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.hint" title="pymongo.cursor.Cursor.hint"><code class="xref py py-meth docutils literal notranslate"><span class="pre">hint()</span></code></a>.</li>
<li>A new socketKeepAlive option for the connection pool.</li>
<li>New generator based BSON decode functions, <a class="reference internal" href="api/bson/index.html#bson.decode_iter" title="bson.decode_iter"><code class="xref py py-func docutils literal notranslate"><span class="pre">decode_iter()</span></code></a>
and <a class="reference internal" href="api/bson/index.html#bson.decode_file_iter" title="bson.decode_file_iter"><code class="xref py py-func docutils literal notranslate"><span class="pre">decode_file_iter()</span></code></a>.</li>
<li>Internal changes to support alternative storage engines like wiredtiger.</li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>There are a number of deprecations in this release for features that
will be removed in PyMongo 3.0. These include:</p>
<ul class="simple">
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">start_request()</span></code></li>
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">in_request()</span></code></li>
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">end_request()</span></code></li>
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">copy_database()</span></code></li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.error" title="pymongo.database.Database.error"><code class="xref py py-meth docutils literal notranslate"><span class="pre">error()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.last_status" title="pymongo.database.Database.last_status"><code class="xref py py-meth docutils literal notranslate"><span class="pre">last_status()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.previous_error" title="pymongo.database.Database.previous_error"><code class="xref py py-meth docutils literal notranslate"><span class="pre">previous_error()</span></code></a></li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.reset_error_history" title="pymongo.database.Database.reset_error_history"><code class="xref py py-meth docutils literal notranslate"><span class="pre">reset_error_history()</span></code></a></li>
<li><code class="xref py py-class docutils literal notranslate"><span class="pre">MasterSlaveConnection</span></code></li>
</ul>
<p class="last">The JSON format for <a class="reference internal" href="api/bson/timestamp.html#bson.timestamp.Timestamp" title="bson.timestamp.Timestamp"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timestamp</span></code></a> has changed from
‘{“t”: &lt;int&gt;, “i”: &lt;int&gt;}’ to ‘{“$timestamp”: {“t”: &lt;int&gt;, “i”: &lt;int&gt;}}’.
This new format will be decoded to an instance of
<a class="reference internal" href="api/bson/timestamp.html#bson.timestamp.Timestamp" title="bson.timestamp.Timestamp"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timestamp</span></code></a>. The old format will continue to be
decoded to a python dict as before. Encoding to the old format is no
longer supported as it was never correct and loses type information.</p>
</div>
<div class="section" id="id26">
<h3>Issues Resolved<a class="headerlink" href="#id26" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=14223">PyMongo 2.8 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-7-2">
<h2>Changes in Version 2.7.2<a class="headerlink" href="#changes-in-version-2-7-2" title="Permalink to this headline">¶</a></h2>
<p>Version 2.7.2 includes fixes for upsert reporting in the bulk API for MongoDB
versions previous to 2.6, a regression in how son manipulators are applied in
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a>, a few obscure connection pool
semaphore leaks, and a few other minor issues. See the list of issues resolved
for full details.</p>
<div class="section" id="id27">
<h3>Issues Resolved<a class="headerlink" href="#id27" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=14005">PyMongo 2.7.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-7-1">
<h2>Changes in Version 2.7.1<a class="headerlink" href="#changes-in-version-2-7-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.7.1 fixes a number of issues reported since the release of 2.7,
most importantly a fix for creating indexes and manipulating users through
mongos versions older than 2.4.0.</p>
<div class="section" id="id28">
<h3>Issues Resolved<a class="headerlink" href="#id28" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=13823">PyMongo 2.7.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-7">
<h2>Changes in Version 2.7<a class="headerlink" href="#changes-in-version-2-7" title="Permalink to this headline">¶</a></h2>
<p>PyMongo 2.7 is a major release with a large number of new features and bug
fixes. Highlights include:</p>
<ul class="simple">
<li>Full support for MongoDB 2.6.</li>
<li>A new <a class="reference internal" href="examples/bulk.html"><span class="doc">bulk write operations API</span></a>.</li>
<li>Support for server side query timeouts using
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.max_time_ms" title="pymongo.cursor.Cursor.max_time_ms"><code class="xref py py-meth docutils literal notranslate"><span class="pre">max_time_ms()</span></code></a>.</li>
<li>Support for writing <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a>
output to a collection.</li>
<li>A new <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.parallel_scan" title="pymongo.collection.Collection.parallel_scan"><code class="xref py py-meth docutils literal notranslate"><span class="pre">parallel_scan()</span></code></a> helper.</li>
<li><a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.OperationFailure" title="pymongo.errors.OperationFailure"><code class="xref py py-class docutils literal notranslate"><span class="pre">OperationFailure</span></code></a> and its subclasses now include
a <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.OperationFailure.details" title="pymongo.errors.OperationFailure.details"><code class="xref py py-attr docutils literal notranslate"><span class="pre">details</span></code></a> attribute with complete
error details from the server.</li>
<li>A new GridFS <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS.find" title="gridfs.GridFS.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a> method that returns a
<a class="reference internal" href="api/gridfs/grid_file.html#gridfs.grid_file.GridOutCursor" title="gridfs.grid_file.GridOutCursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridOutCursor</span></code></a>.</li>
<li>Greatly improved <a class="reference internal" href="examples/mod_wsgi.html"><span class="doc">support for mod_wsgi</span></a> when using
PyMongo’s C extensions. Read <a class="reference external" href="http://emptysqua.re/blog/python-c-extensions-and-mod-wsgi/">Jesse’s blog post</a> for details.</li>
<li>Improved C extension support for ARM little endian.</li>
</ul>
<div class="section" id="breaking-changes">
<h3>Breaking changes<a class="headerlink" href="#breaking-changes" title="Permalink to this headline">¶</a></h3>
<p>Version 2.7 drops support for replica sets running MongoDB versions older
than 1.6.2.</p>
</div>
<div class="section" id="id29">
<h3>Issues Resolved<a class="headerlink" href="#id29" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12892">PyMongo 2.7 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-6-3">
<h2>Changes in Version 2.6.3<a class="headerlink" href="#changes-in-version-2-6-3" title="Permalink to this headline">¶</a></h2>
<p>Version 2.6.3 fixes issues reported since the release of 2.6.2, most
importantly a semaphore leak when a connection to the server fails.</p>
<div class="section" id="id30">
<h3>Issues Resolved<a class="headerlink" href="#id30" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=13098">PyMongo 2.6.3 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-6-2">
<h2>Changes in Version 2.6.2<a class="headerlink" href="#changes-in-version-2-6-2" title="Permalink to this headline">¶</a></h2>
<p>Version 2.6.2 fixes a <code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code> problem when max_pool_size=None
is used in Python 3.</p>
<div class="section" id="id31">
<h3>Issues Resolved<a class="headerlink" href="#id31" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12910">PyMongo 2.6.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-6-1">
<h2>Changes in Version 2.6.1<a class="headerlink" href="#changes-in-version-2-6-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.6.1 fixes a reference leak in
the <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> method.</p>
<div class="section" id="id32">
<h3>Issues Resolved<a class="headerlink" href="#id32" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12905">PyMongo 2.6.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-6">
<h2>Changes in Version 2.6<a class="headerlink" href="#changes-in-version-2-6" title="Permalink to this headline">¶</a></h2>
<p>Version 2.6 includes some frequently requested improvements and adds
support for some early MongoDB 2.6 features.</p>
<p>Special thanks go to Justin Patrin for his work on the connection pool
in this release.</p>
<p>Important new features:</p>
<ul class="simple">
<li>The <code class="docutils literal notranslate"><span class="pre">max_pool_size</span></code> option for <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a>
and <a class="reference internal" href="api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient" title="pymongo.mongo_replica_set_client.MongoReplicaSetClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoReplicaSetClient</span></code></a> now
actually caps the number of sockets the pool will open concurrently.
Once the pool has reached <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.max_pool_size" title="pymongo.mongo_client.MongoClient.max_pool_size"><code class="xref py py-attr docutils literal notranslate"><span class="pre">max_pool_size</span></code></a>
operations will block waiting for a socket to become available. If
<code class="docutils literal notranslate"><span class="pre">waitQueueTimeoutMS</span></code> is set, an operation that blocks waiting for a socket
will raise <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConnectionFailure" title="pymongo.errors.ConnectionFailure"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ConnectionFailure</span></code></a> after the timeout. By
default <code class="docutils literal notranslate"><span class="pre">waitQueueTimeoutMS</span></code> is not set.
See <a class="reference internal" href="faq.html#connection-pooling"><span class="std std-ref">How does connection pooling work in PyMongo?</span></a> for more information.</li>
<li>The <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> method automatically splits
large batches of documents into multiple insert messages based on
<a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.max_message_size" title="pymongo.mongo_client.MongoClient.max_message_size"><code class="xref py py-attr docutils literal notranslate"><span class="pre">max_message_size</span></code></a></li>
<li>Support for the exhaust cursor flag.
See <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a> for details and caveats.</li>
<li>Support for the PLAIN and MONGODB-X509 authentication mechanisms.
See <a class="reference internal" href="examples/authentication.html"><span class="doc">the authentication docs</span></a> for more
information.</li>
<li>Support aggregation output as a <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor" title="pymongo.cursor.Cursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">Cursor</span></code></a>. See
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a> for details.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>SIGNIFICANT BEHAVIOR CHANGE in 2.6. Previously, <cite>max_pool_size</cite>
would limit only the idle sockets the pool would hold onto, not the
number of open sockets. The default has also changed, from 10 to 100.
If you pass a value for <code class="docutils literal notranslate"><span class="pre">max_pool_size</span></code> make sure it is large enough for
the expected load. (Sockets are only opened when needed, so there is no cost
to having a <code class="docutils literal notranslate"><span class="pre">max_pool_size</span></code> larger than necessary. Err towards a larger
value.) If your application accepts the default, continue to do so.</p>
<p class="last">See <a class="reference internal" href="faq.html#connection-pooling"><span class="std std-ref">How does connection pooling work in PyMongo?</span></a> for more information.</p>
</div>
<div class="section" id="id33">
<h3>Issues Resolved<a class="headerlink" href="#id33" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12380">PyMongo 2.6 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-5-2">
<h2>Changes in Version 2.5.2<a class="headerlink" href="#changes-in-version-2-5-2" title="Permalink to this headline">¶</a></h2>
<p>Version 2.5.2 fixes a NULL pointer dereference issue when decoding
an invalid <a class="reference internal" href="api/bson/dbref.html#bson.dbref.DBRef" title="bson.dbref.DBRef"><code class="xref py py-class docutils literal notranslate"><span class="pre">DBRef</span></code></a>.</p>
<div class="section" id="id34">
<h3>Issues Resolved<a class="headerlink" href="#id34" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12581">PyMongo 2.5.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-5-1">
<h2>Changes in Version 2.5.1<a class="headerlink" href="#changes-in-version-2-5-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.5.1 is a minor release that fixes issues discovered after the
release of 2.5. Most importantly, this release addresses some race
conditions in replica set monitoring.</p>
<div class="section" id="id35">
<h3>Issues Resolved<a class="headerlink" href="#id35" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12484">PyMongo 2.5.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-5">
<h2>Changes in Version 2.5<a class="headerlink" href="#changes-in-version-2-5" title="Permalink to this headline">¶</a></h2>
<p>Version 2.5 includes changes to support new features in MongoDB 2.4.</p>
<p>Important new features:</p>
<ul class="simple">
<li>Support for <a class="reference internal" href="examples/authentication.html#gssapi"><span class="std std-ref">GSSAPI (Kerberos) authentication</span></a>.</li>
<li>Support for SSL certificate validation with hostname matching.</li>
<li>Support for delegated and role based authentication.</li>
<li>New GEOSPHERE (2dsphere) and HASHED index constants.</li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.authenticate" title="pymongo.database.Database.authenticate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">authenticate()</span></code></a> now raises a
subclass of <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.PyMongoError" title="pymongo.errors.PyMongoError"><code class="xref py py-class docutils literal notranslate"><span class="pre">PyMongoError</span></code></a> if authentication
fails due to invalid credentials or configuration issues.</p>
</div>
<div class="section" id="id36">
<h3>Issues Resolved<a class="headerlink" href="#id36" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=11981">PyMongo 2.5 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-4-2">
<h2>Changes in Version 2.4.2<a class="headerlink" href="#changes-in-version-2-4-2" title="Permalink to this headline">¶</a></h2>
<p>Version 2.4.2 is a minor release that fixes issues discovered after the
release of 2.4.1. Most importantly, PyMongo will no longer select a replica
set member for read operations that is not in primary or secondary state.</p>
<div class="section" id="id37">
<h3>Issues Resolved<a class="headerlink" href="#id37" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12299">PyMongo 2.4.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-4-1">
<h2>Changes in Version 2.4.1<a class="headerlink" href="#changes-in-version-2-4-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.4.1 is a minor release that fixes issues discovered after the
release of 2.4. Most importantly, this release fixes a regression using
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a>, and possibly other commands,
with mongos.</p>
<div class="section" id="id38">
<h3>Issues Resolved<a class="headerlink" href="#id38" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=12286">PyMongo 2.4.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-4">
<h2>Changes in Version 2.4<a class="headerlink" href="#changes-in-version-2-4" title="Permalink to this headline">¶</a></h2>
<p>Version 2.4 includes a few important new features and a large number of bug
fixes.</p>
<p>Important new features:</p>
<ul class="simple">
<li>New <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> and
<a class="reference internal" href="api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient" title="pymongo.mongo_replica_set_client.MongoReplicaSetClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoReplicaSetClient</span></code></a> classes -
these connection classes do acknowledged write operations (previously referred
to as ‘safe’ writes) by default. <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> and
<code class="xref py py-class docutils literal notranslate"><span class="pre">ReplicaSetConnection</span></code> are deprecated
but still support the old default fire-and-forget behavior.</li>
<li>A new write concern API implemented as a
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.write_concern" title="pymongo.collection.Collection.write_concern"><code class="xref py py-attr docutils literal notranslate"><span class="pre">write_concern</span></code></a> attribute on the connection,
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database" title="pymongo.database.Database"><code class="xref py py-class docutils literal notranslate"><span class="pre">Database</span></code></a>, or <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a>
classes.</li>
<li><a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a> (and <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code>)
now support Unix Domain Sockets.</li>
<li><a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor" title="pymongo.cursor.Cursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">Cursor</span></code></a> can be copied with functions from the <code class="xref py py-mod docutils literal notranslate"><span class="pre">copy</span></code>
module.</li>
<li>The <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.set_profiling_level" title="pymongo.database.Database.set_profiling_level"><code class="xref py py-meth docutils literal notranslate"><span class="pre">set_profiling_level()</span></code></a> method now supports
a <cite>slow_ms</cite> option.</li>
<li>The replica set monitor task (used by
<a class="reference internal" href="api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient" title="pymongo.mongo_replica_set_client.MongoReplicaSetClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoReplicaSetClient</span></code></a> and
<code class="xref py py-class docutils literal notranslate"><span class="pre">ReplicaSetConnection</span></code>) is a daemon thread
once again, meaning you won’t have to call
<a class="reference internal" href="api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient.close" title="pymongo.mongo_replica_set_client.MongoReplicaSetClient.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">close()</span></code></a> before
exiting the python interactive shell.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The constructors for <a class="reference internal" href="api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient" title="pymongo.mongo_client.MongoClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoClient</span></code></a>,
<a class="reference internal" href="api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient" title="pymongo.mongo_replica_set_client.MongoReplicaSetClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">MongoReplicaSetClient</span></code></a>,
<code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code>, and
<code class="xref py py-class docutils literal notranslate"><span class="pre">ReplicaSetConnection</span></code> now raise
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConnectionFailure" title="pymongo.errors.ConnectionFailure"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ConnectionFailure</span></code></a> instead of its subclass
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.AutoReconnect" title="pymongo.errors.AutoReconnect"><code class="xref py py-exc docutils literal notranslate"><span class="pre">AutoReconnect</span></code></a> if the server is unavailable. Applications
that expect to catch <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.AutoReconnect" title="pymongo.errors.AutoReconnect"><code class="xref py py-exc docutils literal notranslate"><span class="pre">AutoReconnect</span></code></a> should now catch
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConnectionFailure" title="pymongo.errors.ConnectionFailure"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ConnectionFailure</span></code></a> while creating a new connection.</p>
</div>
<div class="section" id="id39">
<h3>Issues Resolved<a class="headerlink" href="#id39" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=11485">PyMongo 2.4 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-3">
<h2>Changes in Version 2.3<a class="headerlink" href="#changes-in-version-2-3" title="Permalink to this headline">¶</a></h2>
<p>Version 2.3 adds support for new features and behavior changes in MongoDB
2.2.</p>
<p>Important New Features:</p>
<ul class="simple">
<li>Support for expanded read preferences including directing reads to tagged
servers - See <a class="reference internal" href="examples/high_availability.html#secondary-reads"><span class="std std-ref">Secondary Reads</span></a> for more information.</li>
<li>Support for mongos failover.</li>
<li>A new <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.aggregate" title="pymongo.collection.Collection.aggregate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">aggregate()</span></code></a> method to support
MongoDB’s new <a class="reference external" href="http://docs.mongodb.org/manual/applications/aggregation/">aggregation framework</a>.</li>
<li>Support for legacy Java and C# byte order when encoding and decoding UUIDs.</li>
<li>Support for connecting directly to an arbiter.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Starting with MongoDB 2.2 the getLastError command requires authentication
when the server’s <a class="reference external" href="http://www.mongodb.org/display/DOCS/Security+and+Authentication">authentication features</a> are enabled.
Changes to PyMongo were required to support this behavior change. Users of
authentication must upgrade to PyMongo 2.3 (or newer) for “safe” write operations
to function correctly.</p>
</div>
<div class="section" id="id40">
<h3>Issues Resolved<a class="headerlink" href="#id40" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=11146">PyMongo 2.3 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-2-1">
<h2>Changes in Version 2.2.1<a class="headerlink" href="#changes-in-version-2-2-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.2.1 is a minor release that fixes issues discovered after the
release of 2.2. Most importantly, this release fixes an incompatibility
with mod_wsgi 2.x that could cause connections to leak. Users of mod_wsgi
2.x are strongly encouraged to upgrade from PyMongo 2.2.</p>
<div class="section" id="id41">
<h3>Issues Resolved<a class="headerlink" href="#id41" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=11185">PyMongo 2.2.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-2">
<h2>Changes in Version 2.2<a class="headerlink" href="#changes-in-version-2-2" title="Permalink to this headline">¶</a></h2>
<p>Version 2.2 adds a few more frequently requested features and fixes a
number of bugs.</p>
<p>Special thanks go to Alex Grönholm for his contributions to Python 3
support and maintaining the original pymongo3 port. Christoph Simon,
Wouter Bolsterlee, Mike O’Brien, and Chris Tompkinson also contributed
to this release.</p>
<p>Important New Features:</p>
<ul class="simple">
<li>Support for Python 3 -
See the <a class="reference internal" href="python3.html"><span class="doc">Python 3 FAQ</span></a> for more information.</li>
<li>Support for Gevent -
See <a class="reference internal" href="examples/gevent.html"><span class="doc">Gevent</span></a> for more information.</li>
<li>Improved connection pooling.
See <a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-287">PYTHON-287</a>.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>A number of methods and method parameters that were deprecated in
PyMongo 1.9 or older versions have been removed in this release.
The full list of changes can be found in the following JIRA ticket:</p>
<p><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-305">https://jira.mongodb.org/browse/PYTHON-305</a></p>
<p>BSON module aliases from the pymongo package that were deprecated in
PyMongo 1.9 have also been removed in this release. See the following
JIRA ticket for details:</p>
<p><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-304">https://jira.mongodb.org/browse/PYTHON-304</a></p>
<p class="last">As a result of this cleanup some minor code changes may be required
to use this release.</p>
</div>
<div class="section" id="id42">
<h3>Issues Resolved<a class="headerlink" href="#id42" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=10584">PyMongo 2.2 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-1-1">
<h2>Changes in Version 2.1.1<a class="headerlink" href="#changes-in-version-2-1-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.1.1 is a minor release that fixes a few issues
discovered after the release of 2.1. You can now use
<code class="xref py py-class docutils literal notranslate"><span class="pre">ReplicaSetConnection</span></code>
to run inline map reduce commands on secondaries. See
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.inline_map_reduce" title="pymongo.collection.Collection.inline_map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">inline_map_reduce()</span></code></a> for details.</p>
<p>Special thanks go to Samuel Clay and Ross Lawley for their contributions
to this release.</p>
<div class="section" id="id43">
<h3>Issues Resolved<a class="headerlink" href="#id43" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?version=11081&amp;styleName=Html&amp;projectId=10004">PyMongo 2.1.1 release notes in JIRA</a> for the list of resolved issues
in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-1">
<h2>Changes in Version 2.1<a class="headerlink" href="#changes-in-version-2-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.1 adds a few frequently requested features and includes the usual
round of bug fixes and improvements.</p>
<p>Special thanks go to Alexey Borzenkov, Dan Crosta, Kostya Rybnikov,
Flavio Percoco Premoli, Jonas Haag, and Jesse Davis for their contributions
to this release.</p>
<p>Important New Features:</p>
<ul class="simple">
<li>ReplicaSetConnection -
<code class="xref py py-class docutils literal notranslate"><span class="pre">ReplicaSetConnection</span></code>
can be used to distribute reads to secondaries in a replica set. It supports
automatic failover handling and periodically checks the state of the
replica set to handle issues like primary stepdown or secondaries
being removed for backup operations. Read preferences are defined through
<a class="reference internal" href="api/pymongo/read_preferences.html#pymongo.read_preferences.ReadPreference" title="pymongo.read_preferences.ReadPreference"><code class="xref py py-class docutils literal notranslate"><span class="pre">ReadPreference</span></code></a>.</li>
<li>PyMongo supports the new BSON binary subtype 4 for UUIDs. The default
subtype to use can be set through
<code class="xref py py-attr docutils literal notranslate"><span class="pre">uuid_subtype</span></code>
The current default remains <a class="reference internal" href="api/bson/binary.html#bson.binary.OLD_UUID_SUBTYPE" title="bson.binary.OLD_UUID_SUBTYPE"><code class="xref py py-attr docutils literal notranslate"><span class="pre">OLD_UUID_SUBTYPE</span></code></a> but will
be changed to <a class="reference internal" href="api/bson/binary.html#bson.binary.UUID_SUBTYPE" title="bson.binary.UUID_SUBTYPE"><code class="xref py py-attr docutils literal notranslate"><span class="pre">UUID_SUBTYPE</span></code></a> in a future release.</li>
<li>The getLastError option ‘w’ can be set to a string, allowing for options
like “majority” available in newer version of MongoDB.</li>
<li>Added support for the MongoDB URI options socketTimeoutMS and connectTimeoutMS.</li>
<li>Added support for the ContinueOnError insert flag.</li>
<li>Added basic SSL support.</li>
<li>Added basic support for Jython.</li>
<li>Secondaries can be used for <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.count" title="pymongo.cursor.Cursor.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">count()</span></code></a>,
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.distinct" title="pymongo.cursor.Cursor.distinct"><code class="xref py py-meth docutils literal notranslate"><span class="pre">distinct()</span></code></a>, <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a>,
and querying <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS" title="gridfs.GridFS"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridFS</span></code></a>.</li>
<li>Added document_class and tz_aware options to
<code class="xref py py-class docutils literal notranslate"><span class="pre">MasterSlaveConnection</span></code></li>
</ul>
<div class="section" id="id44">
<h3>Issues Resolved<a class="headerlink" href="#id44" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=10583">PyMongo 2.1 release notes in JIRA</a> for the list of resolved issues in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-2-0-1">
<h2>Changes in Version 2.0.1<a class="headerlink" href="#changes-in-version-2-0-1" title="Permalink to this headline">¶</a></h2>
<p>Version 2.0.1 fixes a regression in <a class="reference internal" href="api/gridfs/grid_file.html#gridfs.grid_file.GridIn" title="gridfs.grid_file.GridIn"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridIn</span></code></a> when
writing pre-chunked strings. Thanks go to Alexey Borzenkov for reporting the
issue and submitting a patch.</p>
<div class="section" id="id45">
<h3>Issues Resolved<a class="headerlink" href="#id45" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-271">PYTHON-271</a>:
Regression in GridFS leads to serious loss of data.</li>
</ul>
</div>
</div>
<div class="section" id="changes-in-version-2-0">
<h2>Changes in Version 2.0<a class="headerlink" href="#changes-in-version-2-0" title="Permalink to this headline">¶</a></h2>
<p>Version 2.0 adds a large number of features and fixes a number of issues.</p>
<p>Special thanks go to James Murty, Abhay Vardhan, David Pisoni, Ryan Smith-Roberts,
Andrew Pendleton, Mher Movsisyan, Reed O’Brien, Michael Schurter, Josip Delic
and Jonas Haag for their contributions to this release.</p>
<p>Important New Features:</p>
<ul class="simple">
<li>PyMongo now performs automatic per-socket database authentication. You no
longer have to re-authenticate for each new thread or after a replica set
failover. Authentication credentials are cached by the driver until the
application calls <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.logout" title="pymongo.database.Database.logout"><code class="xref py py-meth docutils literal notranslate"><span class="pre">logout()</span></code></a>.</li>
<li>slave_okay can be set independently at the connection, database, collection
or query level. Each level will inherit the slave_okay setting from the
previous level and each level can override the previous level’s setting.</li>
<li>safe and getLastError options (e.g. w, wtimeout, etc.) can be set
independently at the connection, database, collection or query level. Each
level will inherit settings from the previous level and each level can
override the previous level’s setting.</li>
<li>PyMongo now supports the <cite>await_data</cite> and <cite>partial</cite> cursor flags. If the
<cite>await_data</cite> flag is set on a <cite>tailable</cite> cursor the server will block for
some extra time waiting for more data to return. The <cite>partial</cite> flag tells
a mongos to return partial data for a query if not all shards are available.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.map_reduce" title="pymongo.collection.Collection.map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">map_reduce()</span></code></a> will accept a <cite>dict</cite> or
instance of <a class="reference internal" href="api/bson/son.html#bson.son.SON" title="bson.son.SON"><code class="xref py py-class docutils literal notranslate"><span class="pre">SON</span></code></a> as the <cite>out</cite> parameter.</li>
<li>The URI parser has been moved into its own module and can be used directly
by application code.</li>
<li>AutoReconnect exception now provides information about the error that
actually occured instead of a generic failure message.</li>
<li>A number of new helper methods have been added with options for setting and
unsetting cursor flags, re-indexing a collection, fsync and locking a server,
and getting the server’s current operations.</li>
</ul>
<p>API changes:</p>
<ul class="simple">
<li>If only one host:port pair is specified <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code>
will make a direct connection to only that host. Please note that <cite>slave_okay</cite>
must be <cite>True</cite> in order to query from a secondary.</li>
<li>If more than one host:port pair is specified or the <cite>replicaset</cite> option is
used PyMongo will treat the specified host:port pair(s) as a seed list and
connect using replica set behavior.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The default subtype for <a class="reference internal" href="api/bson/binary.html#bson.binary.Binary" title="bson.binary.Binary"><code class="xref py py-class docutils literal notranslate"><span class="pre">Binary</span></code></a> has changed
from <a class="reference internal" href="api/bson/binary.html#bson.binary.OLD_BINARY_SUBTYPE" title="bson.binary.OLD_BINARY_SUBTYPE"><code class="xref py py-const docutils literal notranslate"><span class="pre">OLD_BINARY_SUBTYPE</span></code></a> (2) to
<a class="reference internal" href="api/bson/binary.html#bson.binary.BINARY_SUBTYPE" title="bson.binary.BINARY_SUBTYPE"><code class="xref py py-const docutils literal notranslate"><span class="pre">BINARY_SUBTYPE</span></code></a> (0).</p>
</div>
<div class="section" id="id46">
<h3>Issues Resolved<a class="headerlink" href="#id46" title="Permalink to this headline">¶</a></h3>
<p>See the <a class="reference external" href="https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&amp;version=10274">PyMongo 2.0 release notes in JIRA</a> for the list of resolved issues in this release.</p>
</div>
</div>
<div class="section" id="changes-in-version-1-11">
<h2>Changes in Version 1.11<a class="headerlink" href="#changes-in-version-1-11" title="Permalink to this headline">¶</a></h2>
<p>Version 1.11 adds a few new features and fixes a few more bugs.</p>
<p>New Features:</p>
<ul class="simple">
<li>Basic IPv6 support: pymongo prefers IPv4 but will try IPv6. You can
also specify an IPv6 address literal in the <cite>host</cite> parameter or a
MongoDB URI provided it is enclosed in ‘[‘ and ‘]’.</li>
<li>max_pool_size option: previously pymongo had a hard coded pool size
of 10 connections. With this change you can specify a different pool
size as a parameter to <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code>
(max_pool_size=&lt;integer&gt;) or in the MongoDB URI (maxPoolSize=&lt;integer&gt;).</li>
<li>Find by metadata in GridFS: You can know specify query fields as
keyword parameters for <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS.get_version" title="gridfs.GridFS.get_version"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_version()</span></code></a> and
<a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS.get_last_version" title="gridfs.GridFS.get_last_version"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_last_version()</span></code></a>.</li>
<li>Per-query slave_okay option: slave_okay=True is now a valid keyword
argument for <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one" title="pymongo.collection.Collection.find_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one()</span></code></a>.</li>
</ul>
<p>API changes:</p>
<ul class="simple">
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.validate_collection" title="pymongo.database.Database.validate_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">validate_collection()</span></code></a> now returns a
dict instead of a string. This change was required to deal with an
API change on the server. This method also now takes the optional
<cite>scandata</cite> and <cite>full</cite> parameters. See the documentation for more
details.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The <cite>pool_size</cite>, <cite>auto_start_request</cite>, and <cite>timeout</cite> parameters
for <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> have been completely
removed in this release. They were deprecated in pymongo-1.4 and
have had no effect since then. Please make sure that your code
doesn’t currently pass these parameters when creating a
Connection instance.</p>
</div>
<div class="section" id="id47">
<h3>Issues resolved<a class="headerlink" href="#id47" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-241">PYTHON-241</a>:
Support setting slaveok at the cursor level.</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-240">PYTHON-240</a>:
Queries can sometimes permanently fail after a replica set fail over.</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-238">PYTHON-238</a>:
error after few million requests</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-237">PYTHON-237</a>:
Basic IPv6 support.</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-236">PYTHON-236</a>:
Restore option to specify pool size in Connection.</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-212">PYTHON-212</a>:
pymongo does not recover after stale config</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-138">PYTHON-138</a>:
Find method for GridFS</li>
</ul>
</div>
</div>
<div class="section" id="changes-in-version-1-10-1">
<h2>Changes in Version 1.10.1<a class="headerlink" href="#changes-in-version-1-10-1" title="Permalink to this headline">¶</a></h2>
<p>Version 1.10.1 is primarily a bugfix release. It fixes a regression in
version 1.10 that broke pickling of ObjectIds. A number of other bugs
have been fixed as well.</p>
<p>There are two behavior changes to be aware of:</p>
<ul class="simple">
<li>If a read slave raises <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.AutoReconnect" title="pymongo.errors.AutoReconnect"><code class="xref py py-class docutils literal notranslate"><span class="pre">AutoReconnect</span></code></a>
<code class="xref py py-class docutils literal notranslate"><span class="pre">MasterSlaveConnection</span></code> will now
retry the query on each slave until it is successful or all slaves have
raised <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.AutoReconnect" title="pymongo.errors.AutoReconnect"><code class="xref py py-class docutils literal notranslate"><span class="pre">AutoReconnect</span></code></a>. Any other exception will
immediately be raised. The order that the slaves are tried is random.
Previously the read would be sent to one randomly chosen slave and
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.AutoReconnect" title="pymongo.errors.AutoReconnect"><code class="xref py py-class docutils literal notranslate"><span class="pre">AutoReconnect</span></code></a> was immediately raised in case
of a connection failure.</li>
<li>A Python <cite>long</cite> is now always BSON encoded as an int64. Previously the
encoding was based only on the value of the field and a <cite>long</cite> with a
value less than <cite>2147483648</cite> or greater than <cite>-2147483649</cite> would always
be BSON encoded as an int32.</li>
</ul>
<div class="section" id="id48">
<h3>Issues resolved<a class="headerlink" href="#id48" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-234">PYTHON-234</a>:
Fix setup.py to raise exception if any when building extensions</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-233">PYTHON-233</a>:
Add information to build and test with extensions on windows</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-232">PYTHON-232</a>:
Traceback when hashing a DBRef instance</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-231">PYTHON-231</a>:
Traceback when pickling a DBRef instance</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-230">PYTHON-230</a>:
Pickled ObjectIds are not compatible between pymongo 1.9 and 1.10</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-228">PYTHON-228</a>:
Cannot pickle bson.ObjectId</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-227">PYTHON-227</a>:
Traceback when calling find() on system.js</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-216">PYTHON-216</a>:
MasterSlaveConnection is missing disconnect() method</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-186">PYTHON-186</a>:
When storing integers, type is selected according to value instead of type</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-173">PYTHON-173</a>:
as_class option is not propogated by Cursor.clone</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/PYTHON-113">PYTHON-113</a>:
Redunducy in MasterSlaveConnection</li>
</ul>
</div>
</div>
<div class="section" id="changes-in-version-1-10">
<h2>Changes in Version 1.10<a class="headerlink" href="#changes-in-version-1-10" title="Permalink to this headline">¶</a></h2>
<p>Version 1.10 includes changes to support new features in MongoDB 1.8.x.
Highlights include a modified map/reduce API including an inline map/reduce
helper method, a new find_and_modify helper, and the ability to query the
server for the maximum BSON document size it supports.</p>
<ul class="simple">
<li>added <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_and_modify" title="pymongo.collection.Collection.find_and_modify"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_and_modify()</span></code></a>.</li>
<li>added <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.inline_map_reduce" title="pymongo.collection.Collection.inline_map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">inline_map_reduce()</span></code></a>.</li>
<li>changed <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.map_reduce" title="pymongo.collection.Collection.map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">map_reduce()</span></code></a>.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">MongoDB versions greater than 1.7.4 no longer generate temporary
collections for map/reduce results. An output collection name must be
provided and the output will replace any existing output collection with
the same name. <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.map_reduce" title="pymongo.collection.Collection.map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">map_reduce()</span></code></a> now
requires the <cite>out</cite> parameter.</p>
</div>
<div class="section" id="id49">
<h3>Issues resolved<a class="headerlink" href="#id49" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>PYTHON-225: <code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code> class definition should use __slots__.</li>
<li>PYTHON-223: Documentation fix.</li>
<li>PYTHON-220: Documentation fix.</li>
<li>PYTHON-219: KeyError in <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_and_modify" title="pymongo.collection.Collection.find_and_modify"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_and_modify()</span></code></a></li>
<li>PYTHON-213: Query server for maximum BSON document size.</li>
<li>PYTHON-208: Fix <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> __repr__.</li>
<li>PYTHON-207: Changes to Map/Reduce API.</li>
<li>PYTHON-205: Accept slaveOk in the URI to match the URI docs.</li>
<li>PYTHON-203: When slave_okay=True and we only specify one host don’t autodetect other set members.</li>
<li>PYTHON-194: Show size when whining about a document being too large.</li>
<li>PYTHON-184: Raise <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.DuplicateKeyError" title="pymongo.errors.DuplicateKeyError"><code class="xref py py-class docutils literal notranslate"><span class="pre">DuplicateKeyError</span></code></a> for duplicate keys in capped collections.</li>
<li>PYTHON-178: Don’t segfault when trying to encode a recursive data structure.</li>
<li>PYTHON-177: Don’t segfault when decoding dicts with broken iterators.</li>
<li>PYTHON-172: Fix a typo.</li>
<li>PYTHON-170: Add <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_and_modify" title="pymongo.collection.Collection.find_and_modify"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_and_modify()</span></code></a>.</li>
<li>PYTHON-169: Support deepcopy of DBRef.</li>
<li>PYTHON-167: Duplicate of PYTHON-166.</li>
<li>PYTHON-166: Fixes a concurrency issue.</li>
<li>PYTHON-158: Add code and err string to <cite>db assertion</cite> messages.</li>
</ul>
</div>
</div>
<div class="section" id="changes-in-version-1-9">
<h2>Changes in Version 1.9<a class="headerlink" href="#changes-in-version-1-9" title="Permalink to this headline">¶</a></h2>
<p>Version 1.9 adds a new package to the PyMongo distribution,
<a class="reference internal" href="api/bson/index.html#module-bson" title="bson: BSON (Binary JSON) Encoding and Decoding"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a>. <a class="reference internal" href="api/bson/index.html#module-bson" title="bson: BSON (Binary JSON) Encoding and Decoding"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a> contains all of the <a class="reference external" href="http://bsonspec.org">BSON</a> encoding and decoding logic, and the BSON
types that were formerly in the <a class="reference internal" href="api/pymongo/index.html#module-pymongo" title="pymongo: Python driver for MongoDB"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo</span></code></a> package. The following
modules have been renamed:</p>
<blockquote>
<div><ul class="simple">
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.bson</span></code> -&gt; <a class="reference internal" href="api/bson/index.html#module-bson" title="bson: BSON (Binary JSON) Encoding and Decoding"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo._cbson</span></code> -&gt; <code class="xref py py-mod docutils literal notranslate"><span class="pre">bson._cbson</span></code> and
<code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo._cmessage</span></code></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.binary</span></code> -&gt; <a class="reference internal" href="api/bson/binary.html#module-bson.binary" title="bson.binary: Tools for representing binary data to be stored in MongoDB"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.binary</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.code</span></code> -&gt; <a class="reference internal" href="api/bson/code.html#module-bson.code" title="bson.code: Tools for representing JavaScript code"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.code</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.dbref</span></code> -&gt; <a class="reference internal" href="api/bson/dbref.html#module-bson.dbref" title="bson.dbref: Tools for manipulating DBRefs (references to documents stored in MongoDB)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.dbref</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.json_util</span></code> -&gt; <a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.json_util</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.max_key</span></code> -&gt; <a class="reference internal" href="api/bson/max_key.html#module-bson.max_key" title="bson.max_key: Representation for the MongoDB internal MaxKey type"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.max_key</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.min_key</span></code> -&gt; <a class="reference internal" href="api/bson/min_key.html#module-bson.min_key" title="bson.min_key: Representation for the MongoDB internal MinKey type"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.min_key</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.objectid</span></code> -&gt; <a class="reference internal" href="api/bson/objectid.html#module-bson.objectid" title="bson.objectid: Tools for working with MongoDB ObjectIds"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.objectid</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.son</span></code> -&gt; <a class="reference internal" href="api/bson/son.html#module-bson.son" title="bson.son: Tools for working with SON, an ordered mapping"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.son</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.timestamp</span></code> -&gt; <a class="reference internal" href="api/bson/timestamp.html#module-bson.timestamp" title="bson.timestamp: Tools for representing MongoDB internal Timestamps"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.timestamp</span></code></a></li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymongo.tz_util</span></code> -&gt; <a class="reference internal" href="api/bson/tz_util.html#module-bson.tz_util" title="bson.tz_util: Utilities for dealing with timezones in Python"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson.tz_util</span></code></a></li>
</ul>
</div></blockquote>
<p>In addition, the following exception classes have been renamed:</p>
<blockquote>
<div><ul class="simple">
<li><code class="xref py py-class docutils literal notranslate"><span class="pre">pymongo.errors.InvalidBSON</span></code> -&gt;
<a class="reference internal" href="api/bson/errors.html#bson.errors.InvalidBSON" title="bson.errors.InvalidBSON"><code class="xref py py-class docutils literal notranslate"><span class="pre">bson.errors.InvalidBSON</span></code></a></li>
<li><code class="xref py py-class docutils literal notranslate"><span class="pre">pymongo.errors.InvalidStringData</span></code> -&gt;
<a class="reference internal" href="api/bson/errors.html#bson.errors.InvalidStringData" title="bson.errors.InvalidStringData"><code class="xref py py-class docutils literal notranslate"><span class="pre">bson.errors.InvalidStringData</span></code></a></li>
<li><code class="xref py py-class docutils literal notranslate"><span class="pre">pymongo.errors.InvalidDocument</span></code> -&gt;
<a class="reference internal" href="api/bson/errors.html#bson.errors.InvalidDocument" title="bson.errors.InvalidDocument"><code class="xref py py-class docutils literal notranslate"><span class="pre">bson.errors.InvalidDocument</span></code></a></li>
<li><code class="xref py py-class docutils literal notranslate"><span class="pre">pymongo.errors.InvalidId</span></code> -&gt;
<a class="reference internal" href="api/bson/errors.html#bson.errors.InvalidId" title="bson.errors.InvalidId"><code class="xref py py-class docutils literal notranslate"><span class="pre">bson.errors.InvalidId</span></code></a></li>
</ul>
</div></blockquote>
<p>The above exceptions now inherit from <a class="reference internal" href="api/bson/errors.html#bson.errors.BSONError" title="bson.errors.BSONError"><code class="xref py py-class docutils literal notranslate"><span class="pre">bson.errors.BSONError</span></code></a>
rather than <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.PyMongoError" title="pymongo.errors.PyMongoError"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymongo.errors.PyMongoError</span></code></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">All of the renamed modules and exceptions above have aliases
created with the old names, so these changes should not break
existing code. The old names will eventually be deprecated and then
removed, so users should begin migrating towards the new names now.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The change to the exception hierarchy mentioned above is
possibly breaking. If your code is catching
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.PyMongoError" title="pymongo.errors.PyMongoError"><code class="xref py py-class docutils literal notranslate"><span class="pre">PyMongoError</span></code></a>, then the exceptions raised
by <a class="reference internal" href="api/bson/index.html#module-bson" title="bson: BSON (Binary JSON) Encoding and Decoding"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a> will not be caught, even though they would have been
caught previously. Before upgrading, it is recommended that users
check for any cases like this.</p>
</div>
<ul class="simple">
<li>the C extension now shares buffer.c/h with the Ruby driver</li>
<li><a class="reference internal" href="api/bson/index.html#module-bson" title="bson: BSON (Binary JSON) Encoding and Decoding"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bson</span></code></a> no longer raises <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.InvalidName" title="pymongo.errors.InvalidName"><code class="xref py py-class docutils literal notranslate"><span class="pre">InvalidName</span></code></a>,
all occurrences have been replaced with
<a class="reference internal" href="api/bson/errors.html#bson.errors.InvalidDocument" title="bson.errors.InvalidDocument"><code class="xref py py-class docutils literal notranslate"><span class="pre">InvalidDocument</span></code></a>.</li>
<li>renamed <code class="xref py py-meth docutils literal notranslate"><span class="pre">bson._to_dicts()</span></code> to <a class="reference internal" href="api/bson/index.html#bson.decode_all" title="bson.decode_all"><code class="xref py py-meth docutils literal notranslate"><span class="pre">decode_all()</span></code></a>.</li>
<li>renamed <code class="xref py py-meth docutils literal notranslate"><span class="pre">from_dict()</span></code> to <a class="reference internal" href="api/bson/index.html#bson.BSON.encode" title="bson.BSON.encode"><code class="xref py py-meth docutils literal notranslate"><span class="pre">encode()</span></code></a>
and <code class="xref py py-meth docutils literal notranslate"><span class="pre">to_dict()</span></code> to <a class="reference internal" href="api/bson/index.html#bson.BSON.decode" title="bson.BSON.decode"><code class="xref py py-meth docutils literal notranslate"><span class="pre">decode()</span></code></a>.</li>
<li>added <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.batch_size" title="pymongo.cursor.Cursor.batch_size"><code class="xref py py-meth docutils literal notranslate"><span class="pre">batch_size()</span></code></a>.</li>
<li>allow updating (some) file metadata after a
<a class="reference internal" href="api/gridfs/grid_file.html#gridfs.grid_file.GridIn" title="gridfs.grid_file.GridIn"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridIn</span></code></a> instance has been closed.</li>
<li>performance improvements for reading from GridFS.</li>
<li>special cased slice with the same start and stop to return an empty
cursor.</li>
<li>allow writing <code class="xref py py-class docutils literal notranslate"><span class="pre">unicode</span></code> to GridFS if an <code class="xref py py-attr docutils literal notranslate"><span class="pre">encoding</span></code>
attribute has been specified for the file.</li>
<li>added <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS.get_version" title="gridfs.GridFS.get_version"><code class="xref py py-meth docutils literal notranslate"><span class="pre">gridfs.GridFS.get_version()</span></code></a>.</li>
<li>scope variables for <a class="reference internal" href="api/bson/code.html#bson.code.Code" title="bson.code.Code"><code class="xref py py-class docutils literal notranslate"><span class="pre">Code</span></code></a> can now be specified as
keyword arguments.</li>
<li>added <a class="reference internal" href="api/gridfs/grid_file.html#gridfs.grid_file.GridOut.readline" title="gridfs.grid_file.GridOut.readline"><code class="xref py py-meth docutils literal notranslate"><span class="pre">readline()</span></code></a> to
<a class="reference internal" href="api/gridfs/grid_file.html#gridfs.grid_file.GridOut" title="gridfs.grid_file.GridOut"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridOut</span></code></a>.</li>
<li>make a best effort to transparently auto-reconnect if a
<code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> has been idle for a while.</li>
<li>added <a class="reference internal" href="api/pymongo/database.html#pymongo.database.SystemJS.list" title="pymongo.database.SystemJS.list"><code class="xref py py-meth docutils literal notranslate"><span class="pre">list()</span></code></a> to
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.SystemJS" title="pymongo.database.SystemJS"><code class="xref py py-class docutils literal notranslate"><span class="pre">SystemJS</span></code></a>.</li>
<li>added <cite>file_document</cite> argument to <a class="reference internal" href="api/gridfs/grid_file.html#gridfs.grid_file.GridOut" title="gridfs.grid_file.GridOut"><code class="xref py py-meth docutils literal notranslate"><span class="pre">GridOut()</span></code></a>
to allow initializing from an existing file document.</li>
<li>raise <code class="xref py py-class docutils literal notranslate"><span class="pre">TimeoutError</span></code> even if the
<code class="docutils literal notranslate"><span class="pre">getLastError</span></code> command was run manually and not through “safe”
mode.</li>
<li>added <code class="xref py py-class docutils literal notranslate"><span class="pre">uuid</span></code> support to <a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">json_util</span></code></a>.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-8-1">
<h2>Changes in Version 1.8.1<a class="headerlink" href="#changes-in-version-1-8-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>fixed a typo in the C extension that could cause safe-mode
operations to report a failure (<code class="xref py py-class docutils literal notranslate"><span class="pre">SystemError</span></code>) even when none
occurred.</li>
<li>added a <code class="xref py py-meth docutils literal notranslate"><span class="pre">__ne__()</span></code> implementation to any class where we define
<code class="xref py py-meth docutils literal notranslate"><span class="pre">__eq__()</span></code>.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-8">
<h2>Changes in Version 1.8<a class="headerlink" href="#changes-in-version-1-8" title="Permalink to this headline">¶</a></h2>
<p>Version 1.8 adds support for connecting to replica sets, specifying
per-operation values for <cite>w</cite> and <cite>wtimeout</cite>, and decoding to
timezone-aware datetimes.</p>
<ul class="simple">
<li>fixed a reference leak in the C extension when decoding a
<a class="reference internal" href="api/bson/dbref.html#bson.dbref.DBRef" title="bson.dbref.DBRef"><code class="xref py py-class docutils literal notranslate"><span class="pre">DBRef</span></code></a>.</li>
<li>added support for <cite>w</cite>, <cite>wtimeout</cite>, and <cite>fsync</cite> (and any other
options for <cite>getLastError</cite>) to “safe mode” operations.</li>
<li>added <code class="xref py py-attr docutils literal notranslate"><span class="pre">nodes</span></code> property.</li>
<li>added a maximum pool size of 10 sockets.</li>
<li>added support for replica sets.</li>
<li>DEPRECATED <code class="xref py py-meth docutils literal notranslate"><span class="pre">from_uri()</span></code> and
<code class="xref py py-meth docutils literal notranslate"><span class="pre">paired()</span></code>, both are supplanted
by extended functionality in <code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection()</span></code>.</li>
<li>added tz aware support for datetimes in
<a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a>,
<a class="reference internal" href="api/bson/timestamp.html#bson.timestamp.Timestamp" title="bson.timestamp.Timestamp"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timestamp</span></code></a> and <a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">json_util</span></code></a>
methods.</li>
<li>added <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop" title="pymongo.collection.Collection.drop"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop()</span></code></a> helper.</li>
<li>reuse the socket used for finding the master when a
<code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> is first created.</li>
<li>added support for <a class="reference internal" href="api/bson/min_key.html#bson.min_key.MinKey" title="bson.min_key.MinKey"><code class="xref py py-class docutils literal notranslate"><span class="pre">MinKey</span></code></a>,
<a class="reference internal" href="api/bson/max_key.html#bson.max_key.MaxKey" title="bson.max_key.MaxKey"><code class="xref py py-class docutils literal notranslate"><span class="pre">MaxKey</span></code></a> and
<a class="reference internal" href="api/bson/timestamp.html#bson.timestamp.Timestamp" title="bson.timestamp.Timestamp"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timestamp</span></code></a> to <a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">json_util</span></code></a>.</li>
<li>added support for decoding datetimes as aware (UTC) - it is highly
recommended to enable this by setting the <cite>tz_aware</cite> parameter to
<code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection()</span></code> to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</li>
<li>added <cite>network_timeout</cite> option for individual calls to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one" title="pymongo.collection.Collection.find_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one()</span></code></a>.</li>
<li>added <a class="reference internal" href="api/gridfs/index.html#gridfs.GridFS.exists" title="gridfs.GridFS.exists"><code class="xref py py-meth docutils literal notranslate"><span class="pre">exists()</span></code></a> to check if a file exists in
GridFS.</li>
<li>added support for additional keys in <a class="reference internal" href="api/bson/dbref.html#bson.dbref.DBRef" title="bson.dbref.DBRef"><code class="xref py py-class docutils literal notranslate"><span class="pre">DBRef</span></code></a>
instances.</li>
<li>added <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.OperationFailure.code" title="pymongo.errors.OperationFailure.code"><code class="xref py py-attr docutils literal notranslate"><span class="pre">code</span></code></a> attribute to
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.OperationFailure" title="pymongo.errors.OperationFailure"><code class="xref py py-class docutils literal notranslate"><span class="pre">OperationFailure</span></code></a> exceptions.</li>
<li>fixed serialization of int and float subclasses in the C extension.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-7">
<h2>Changes in Version 1.7<a class="headerlink" href="#changes-in-version-1-7" title="Permalink to this headline">¶</a></h2>
<p>Version 1.7 is a recommended upgrade for all PyMongo users. The full
release notes are below, and some more in depth discussion of the
highlights is <a class="reference external" href="http://dirolf.com/2010/06/17/pymongo-1.7-released.html">here</a>.</p>
<ul class="simple">
<li>no longer attempt to build the C extension on big-endian systems.</li>
<li>added <a class="reference internal" href="api/bson/min_key.html#bson.min_key.MinKey" title="bson.min_key.MinKey"><code class="xref py py-class docutils literal notranslate"><span class="pre">MinKey</span></code></a> and
<a class="reference internal" href="api/bson/max_key.html#bson.max_key.MaxKey" title="bson.max_key.MaxKey"><code class="xref py py-class docutils literal notranslate"><span class="pre">MaxKey</span></code></a>.</li>
<li>use unsigned for <a class="reference internal" href="api/bson/timestamp.html#bson.timestamp.Timestamp" title="bson.timestamp.Timestamp"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timestamp</span></code></a> in BSON
encoder/decoder.</li>
<li>support <code class="docutils literal notranslate"><span class="pre">True</span></code> as <code class="docutils literal notranslate"><span class="pre">&quot;ok&quot;</span></code> in command responses, in addition to
<code class="docutils literal notranslate"><span class="pre">1.0</span></code> - necessary for server versions <strong>&gt;= 1.5.X</strong></li>
<li>BREAKING change to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.index_information" title="pymongo.collection.Collection.index_information"><code class="xref py py-meth docutils literal notranslate"><span class="pre">index_information()</span></code></a> to add
support for querying unique status and other index information.</li>
<li>added <code class="xref py py-attr docutils literal notranslate"><span class="pre">document_class</span></code>, to
specify class for returned documents.</li>
<li>added <cite>as_class</cite> argument for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a>, and in the BSON decoder.</li>
<li>added support for creating <a class="reference internal" href="api/bson/timestamp.html#bson.timestamp.Timestamp" title="bson.timestamp.Timestamp"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timestamp</span></code></a>
instances using a <code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code>.</li>
<li>allow <cite>dropTarget</cite> argument for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.rename" title="pymongo.collection.Collection.rename"><code class="xref py py-class docutils literal notranslate"><span class="pre">rename</span></code></a>.</li>
<li>handle aware <code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code> instances, by converting to
UTC.</li>
<li>added support for <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.max_scan" title="pymongo.cursor.Cursor.max_scan"><code class="xref py py-class docutils literal notranslate"><span class="pre">max_scan</span></code></a>.</li>
<li>raise <a class="reference internal" href="api/gridfs/errors.html#gridfs.errors.FileExists" title="gridfs.errors.FileExists"><code class="xref py py-class docutils literal notranslate"><span class="pre">FileExists</span></code></a> exception when creating a
duplicate GridFS file.</li>
<li>use <a class="reference external" href="http://code.google.com/p/y2038/">y2038</a> for time handling in
the C extension - eliminates 2038 problems when extension is
installed.</li>
<li>added <cite>sort</cite> parameter to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a></li>
<li>finalized deprecation of changes from versions <strong>&lt;= 1.4</strong></li>
<li>take any non-<code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code> as an <code class="docutils literal notranslate"><span class="pre">&quot;_id&quot;</span></code> query for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find_one" title="pymongo.collection.Collection.find_one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find_one()</span></code></a> or
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.remove" title="pymongo.collection.Collection.remove"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove()</span></code></a></li>
<li>added ability to pass a <code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code> for <cite>fields</cite> argument to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a> (supports <code class="docutils literal notranslate"><span class="pre">&quot;$slice&quot;</span></code>
and field negation)</li>
<li>simplified code to find master, since paired setups don’t always have
a remote</li>
<li>fixed bug in C encoder for certain invalid types (like
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a> instances).</li>
<li>don’t transparently map <code class="docutils literal notranslate"><span class="pre">&quot;filename&quot;</span></code> key to <code class="xref py py-attr docutils literal notranslate"><span class="pre">name</span></code> attribute
for GridFS.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-6">
<h2>Changes in Version 1.6<a class="headerlink" href="#changes-in-version-1-6" title="Permalink to this headline">¶</a></h2>
<p>The biggest change in version 1.6 is a complete re-implementation of
<a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a> with a lot of improvements over the old
implementation. There are many details and examples of using the new
API in <a class="reference external" href="http://dirolf.com/2010/03/29/new-gridfs-implementation-for-pymongo.html">this blog post</a>. The
old API has been removed in this version, so existing code will need
to be modified before upgrading to 1.6.</p>
<ul class="simple">
<li>fixed issue where connection pool was being shared across
<code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> instances.</li>
<li>more improvements to Python code caching in C extension - should
improve behavior on mod_wsgi.</li>
<li>added <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId.from_datetime" title="bson.objectid.ObjectId.from_datetime"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_datetime()</span></code></a>.</li>
<li>complete rewrite of <a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a> support.</li>
<li>improvements to the <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.command" title="pymongo.database.Database.command"><code class="xref py py-meth docutils literal notranslate"><span class="pre">command()</span></code></a> API.</li>
<li>fixed <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.drop_indexes" title="pymongo.collection.Collection.drop_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">drop_indexes()</span></code></a> behavior
on non-existent collections.</li>
<li>disallow empty bulk inserts.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-5-2">
<h2>Changes in Version 1.5.2<a class="headerlink" href="#changes-in-version-1-5-2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>fixed response handling to ignore unknown response flags in queries.</li>
<li>handle server versions containing ‘-pre-‘.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-5-1">
<h2>Changes in Version 1.5.1<a class="headerlink" href="#changes-in-version-1-5-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>added <code class="xref py py-data docutils literal notranslate"><span class="pre">_id</span></code> property for
<code class="xref py py-class docutils literal notranslate"><span class="pre">GridFile</span></code> instances.</li>
<li>fix for making a <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> (with
<cite>slave_okay</cite> set) directly to a slave in a replica pair.</li>
<li>accept kwargs for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_index" title="pymongo.collection.Collection.create_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_index()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.ensure_index" title="pymongo.collection.Collection.ensure_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ensure_index()</span></code></a> to support all
indexing options.</li>
<li>add <a class="reference internal" href="api/pymongo/collection.html#pymongo.GEO2D" title="pymongo.GEO2D"><code class="xref py py-data docutils literal notranslate"><span class="pre">pymongo.GEO2D</span></code></a> and support for geo indexing.</li>
<li>improvements to Python code caching in C extension - should improve
behavior on mod_wsgi.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-5">
<h2>Changes in Version 1.5<a class="headerlink" href="#changes-in-version-1-5" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>added subtype constants to <a class="reference internal" href="api/bson/binary.html#module-bson.binary" title="bson.binary: Tools for representing binary data to be stored in MongoDB"><code class="xref py py-mod docutils literal notranslate"><span class="pre">binary</span></code></a> module.</li>
<li>DEPRECATED <cite>options</cite> argument to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Collection()</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.create_collection" title="pymongo.database.Database.create_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_collection()</span></code></a> in favor of
kwargs.</li>
<li>added <a class="reference internal" href="api/pymongo/index.html#pymongo.has_c" title="pymongo.has_c"><code class="xref py py-meth docutils literal notranslate"><span class="pre">has_c()</span></code></a> to check for C extension.</li>
<li>added <code class="xref py py-meth docutils literal notranslate"><span class="pre">copy_database()</span></code>.</li>
<li>added <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.alive" title="pymongo.cursor.Cursor.alive"><code class="xref py py-data docutils literal notranslate"><span class="pre">alive</span></code></a> to tell when a cursor
might have more data to return (useful for tailable cursors).</li>
<li>added <a class="reference internal" href="api/bson/timestamp.html#bson.timestamp.Timestamp" title="bson.timestamp.Timestamp"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timestamp</span></code></a> to better support
dealing with internal MongoDB timestamps.</li>
<li>added <cite>name</cite> argument for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_index" title="pymongo.collection.Collection.create_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_index()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.ensure_index" title="pymongo.collection.Collection.ensure_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ensure_index()</span></code></a>.</li>
<li>fixed connection pooling w/ fork</li>
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">paired()</span></code> takes all kwargs that
are allowed for <code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection()</span></code>.</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> returns list for bulk
inserts of size one.</li>
<li>fixed handling of <code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.datetime</span></code> instances in
<a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">json_util</span></code></a>.</li>
<li>added <code class="xref py py-meth docutils literal notranslate"><span class="pre">from_uri()</span></code> to support
MongoDB connection uri scheme.</li>
<li>fixed chunk number calculation when unaligned in <a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a>.</li>
<li><a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.command" title="pymongo.database.Database.command"><code class="xref py py-meth docutils literal notranslate"><span class="pre">command()</span></code></a> takes a string for simple
commands.</li>
<li>added <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.system_js" title="pymongo.database.Database.system_js"><code class="xref py py-data docutils literal notranslate"><span class="pre">system_js</span></code></a> helper for
dealing with server-side JS.</li>
<li>don’t wrap queries containing <code class="docutils literal notranslate"><span class="pre">&quot;$query&quot;</span></code> (support manual use of
<code class="docutils literal notranslate"><span class="pre">&quot;$min&quot;</span></code>, etc.).</li>
<li>added <a class="reference internal" href="api/gridfs/errors.html#gridfs.errors.GridFSError" title="gridfs.errors.GridFSError"><code class="xref py py-class docutils literal notranslate"><span class="pre">GridFSError</span></code></a> as base class for
<a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a> exceptions.</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-4">
<h2>Changes in Version 1.4<a class="headerlink" href="#changes-in-version-1-4" title="Permalink to this headline">¶</a></h2>
<p>Perhaps the most important change in version 1.4 is that we have
decided to <strong>no longer support Python 2.3</strong>. The most immediate reason
for this is to allow some improvements to connection pooling. This
will also allow us to use some new (as in Python 2.4 ;) idioms and
will help begin the path towards supporting Python 3.0. If you need to
use Python 2.3 you should consider using version 1.3 of this driver,
although that will no longer be actively supported.</p>
<p>Other changes:</p>
<ul class="simple">
<li>move <code class="docutils literal notranslate"><span class="pre">&quot;_id&quot;</span></code> to front only for top-level documents (fixes some
corner cases).</li>
<li><a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update" title="pymongo.collection.Collection.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.remove" title="pymongo.collection.Collection.remove"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove()</span></code></a> return the entire
response to the <em>lastError</em> command when safe is <code class="docutils literal notranslate"><span class="pre">True</span></code>.</li>
<li>completed removal of things that were deprecated in version 1.2 or
earlier.</li>
<li>enforce that collection names do not contain the NULL byte.</li>
<li>fix to allow using UTF-8 collection names with the C extension.</li>
<li>added <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.PyMongoError" title="pymongo.errors.PyMongoError"><code class="xref py py-class docutils literal notranslate"><span class="pre">PyMongoError</span></code></a> as base exception class
for all <a class="reference internal" href="api/pymongo/errors.html#module-pymongo.errors" title="pymongo.errors: Exceptions raised by the pymongo package"><code class="xref py py-mod docutils literal notranslate"><span class="pre">errors</span></code></a>. this changes the exception hierarchy
somewhat, and is a BREAKING change if you depend on
<a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConnectionFailure" title="pymongo.errors.ConnectionFailure"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConnectionFailure</span></code></a> being a <code class="xref py py-class docutils literal notranslate"><span class="pre">IOError</span></code>
or <a class="reference internal" href="api/bson/errors.html#bson.errors.InvalidBSON" title="bson.errors.InvalidBSON"><code class="xref py py-class docutils literal notranslate"><span class="pre">InvalidBSON</span></code></a> being a <code class="xref py py-class docutils literal notranslate"><span class="pre">ValueError</span></code>,
for example.</li>
<li>added <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.DuplicateKeyError" title="pymongo.errors.DuplicateKeyError"><code class="xref py py-class docutils literal notranslate"><span class="pre">DuplicateKeyError</span></code></a> for calls to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> or
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update" title="pymongo.collection.Collection.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code></a> with <cite>safe</cite> set to
<code class="docutils literal notranslate"><span class="pre">True</span></code>.</li>
<li>removed <code class="xref py py-mod docutils literal notranslate"><span class="pre">thread_util</span></code>.</li>
<li>added <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.add_user" title="pymongo.database.Database.add_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_user()</span></code></a> and
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.remove_user" title="pymongo.database.Database.remove_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove_user()</span></code></a> helpers.</li>
<li>fix for <a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.authenticate" title="pymongo.database.Database.authenticate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">authenticate()</span></code></a> when using
non-UTF-8 names or passwords.</li>
<li>minor fixes for
<code class="xref py py-class docutils literal notranslate"><span class="pre">MasterSlaveConnection</span></code>.</li>
<li>clean up all cases where <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.ConnectionFailure" title="pymongo.errors.ConnectionFailure"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConnectionFailure</span></code></a>
is raised.</li>
<li>simplification of connection pooling - makes driver ~2x faster for
simple benchmarks. see <a class="reference internal" href="faq.html#connection-pooling"><span class="std std-ref">How does connection pooling work in PyMongo?</span></a> for more information.</li>
<li>DEPRECATED <cite>pool_size</cite>, <cite>auto_start_request</cite> and <cite>timeout</cite>
parameters to <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code>. DEPRECATED
<code class="xref py py-meth docutils literal notranslate"><span class="pre">start_request()</span></code>.</li>
<li>use <code class="xref py py-meth docutils literal notranslate"><span class="pre">socket.sendall()</span></code>.</li>
<li>removed <code class="xref py py-meth docutils literal notranslate"><span class="pre">from_xml()</span></code> as it was only being used
for some internal testing - also eliminates dependency on
<code class="xref py py-mod docutils literal notranslate"><span class="pre">elementtree</span></code>.</li>
<li>implementation of <a class="reference internal" href="api/pymongo/message.html#pymongo.message.update" title="pymongo.message.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code></a> in C.</li>
<li>deprecate <code class="xref py py-meth docutils literal notranslate"><span class="pre">_command()</span></code> in favor of
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.command" title="pymongo.database.Database.command"><code class="xref py py-meth docutils literal notranslate"><span class="pre">command()</span></code></a>.</li>
<li>send all commands without wrapping as <code class="docutils literal notranslate"><span class="pre">{&quot;query&quot;:</span> <span class="pre">...}</span></code>.</li>
<li>support string as <cite>key</cite> argument to
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a> (keyf) and run all
groups as commands.</li>
<li>support for equality testing for <a class="reference internal" href="api/bson/code.html#bson.code.Code" title="bson.code.Code"><code class="xref py py-class docutils literal notranslate"><span class="pre">Code</span></code></a>
instances.</li>
<li>allow the NULL byte in strings and disallow it in key names or regex
patterns</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-3">
<h2>Changes in Version 1.3<a class="headerlink" href="#changes-in-version-1-3" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>DEPRECATED running <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a> as
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.eval" title="pymongo.database.Database.eval"><code class="xref py py-meth docutils literal notranslate"><span class="pre">eval()</span></code></a>, also changed default for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a> to running as a command</li>
<li>remove <code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.cursor.Cursor.__len__()</span></code>, which was deprecated
in 1.1.1 - needed to do this aggressively due to it’s presence
breaking <strong>Django</strong> template <em>for</em> loops</li>
<li>DEPRECATED <code class="xref py py-meth docutils literal notranslate"><span class="pre">host()</span></code>,
<code class="xref py py-meth docutils literal notranslate"><span class="pre">port()</span></code>,
<code class="xref py py-meth docutils literal notranslate"><span class="pre">connection()</span></code>,
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.name" title="pymongo.database.Database.name"><code class="xref py py-meth docutils literal notranslate"><span class="pre">name()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.database" title="pymongo.collection.Collection.database"><code class="xref py py-meth docutils literal notranslate"><span class="pre">database()</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.name" title="pymongo.collection.Collection.name"><code class="xref py py-meth docutils literal notranslate"><span class="pre">name()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.full_name" title="pymongo.collection.Collection.full_name"><code class="xref py py-meth docutils literal notranslate"><span class="pre">full_name()</span></code></a> in favor of
<code class="xref py py-attr docutils literal notranslate"><span class="pre">host</span></code>,
<code class="xref py py-attr docutils literal notranslate"><span class="pre">port</span></code>,
<code class="xref py py-attr docutils literal notranslate"><span class="pre">connection</span></code>,
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database.name" title="pymongo.database.Database.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">name</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.database" title="pymongo.collection.Collection.database"><code class="xref py py-attr docutils literal notranslate"><span class="pre">database</span></code></a>,
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.name" title="pymongo.collection.Collection.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">name</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.full_name" title="pymongo.collection.Collection.full_name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">full_name</span></code></a>, respectively. The
deprecation schedule for this change will probably be faster than
usual, as it carries some performance implications.</li>
<li>added <code class="xref py py-meth docutils literal notranslate"><span class="pre">disconnect()</span></code></li>
</ul>
</div>
<div class="section" id="changes-in-version-1-2-1">
<h2>Changes in Version 1.2.1<a class="headerlink" href="#changes-in-version-1-2-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>added <a class="reference internal" href="#"><span class="doc">Changelog</span></a> to docs</li>
<li>added <code class="docutils literal notranslate"><span class="pre">setup.py</span> <span class="pre">doc</span> <span class="pre">--test</span></code> to run doctests for tutorial, examples</li>
<li>moved most examples to Sphinx docs (and remove from <em>examples/</em>
directory)</li>
<li>raise <a class="reference internal" href="api/bson/errors.html#bson.errors.InvalidId" title="bson.errors.InvalidId"><code class="xref py py-class docutils literal notranslate"><span class="pre">InvalidId</span></code></a> instead of
<code class="xref py py-class docutils literal notranslate"><span class="pre">TypeError</span></code> when passing a 24 character string to
<a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a> that contains non-hexadecimal
characters</li>
<li>allow <code class="xref py py-class docutils literal notranslate"><span class="pre">unicode</span></code> instances for <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a> init</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-2">
<h2>Changes in Version 1.2<a class="headerlink" href="#changes-in-version-1-2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><cite>spec</cite> parameter for <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.remove" title="pymongo.collection.Collection.remove"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove()</span></code></a> is
now optional to allow for deleting all documents in a
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a></li>
<li>always wrap queries with <code class="docutils literal notranslate"><span class="pre">{query:</span> <span class="pre">...}</span></code> even when no special options -
get around some issues with queries on fields named <code class="docutils literal notranslate"><span class="pre">query</span></code></li>
<li>enforce 4MB document limit on the client side</li>
<li>added <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.map_reduce" title="pymongo.collection.Collection.map_reduce"><code class="xref py py-meth docutils literal notranslate"><span class="pre">map_reduce()</span></code></a> helper - see
<a class="reference internal" href="examples/aggregation.html"><span class="doc">example</span></a></li>
<li>added <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.distinct" title="pymongo.cursor.Cursor.distinct"><code class="xref py py-meth docutils literal notranslate"><span class="pre">distinct()</span></code></a> method on
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor" title="pymongo.cursor.Cursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">Cursor</span></code></a> instances to allow distinct with
queries</li>
<li>fix for <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.__getitem__" title="pymongo.cursor.Cursor.__getitem__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__getitem__()</span></code></a> after
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.skip" title="pymongo.cursor.Cursor.skip"><code class="xref py py-meth docutils literal notranslate"><span class="pre">skip()</span></code></a></li>
<li>allow any UTF-8 string in <a class="reference internal" href="api/bson/index.html#bson.BSON" title="bson.BSON"><code class="xref py py-class docutils literal notranslate"><span class="pre">BSON</span></code></a> encoder, not
just ASCII subset</li>
<li>added <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId.generation_time" title="bson.objectid.ObjectId.generation_time"><code class="xref py py-attr docutils literal notranslate"><span class="pre">generation_time</span></code></a></li>
<li>removed support for legacy <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a>
format - pretty sure this was never used, and is just confusing</li>
<li>DEPRECATED <code class="xref py py-meth docutils literal notranslate"><span class="pre">url_encode()</span></code> and
<code class="xref py py-meth docutils literal notranslate"><span class="pre">url_decode()</span></code> in favor of <code class="xref py py-meth docutils literal notranslate"><span class="pre">str()</span></code>
and <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ObjectId()</span></code></a>, respectively</li>
<li>allow <em>oplog.$main</em> as a valid collection name</li>
<li>some minor fixes for installation process</li>
<li>added support for datetime and regex in <a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">json_util</span></code></a></li>
</ul>
</div>
<div class="section" id="changes-in-version-1-1-2">
<h2>Changes in Version 1.1.2<a class="headerlink" href="#changes-in-version-1-1-2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>improvements to <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> speed
(using C for insert message creation)</li>
<li>use random number for request_id</li>
<li>fix some race conditions with <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.AutoReconnect" title="pymongo.errors.AutoReconnect"><code class="xref py py-class docutils literal notranslate"><span class="pre">AutoReconnect</span></code></a></li>
</ul>
</div>
<div class="section" id="changes-in-version-1-1-1">
<h2>Changes in Version 1.1.1<a class="headerlink" href="#changes-in-version-1-1-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>added <cite>multi</cite> parameter for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.update" title="pymongo.collection.Collection.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code></a></li>
<li>fix unicode regex patterns with C extension</li>
<li>added <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.distinct" title="pymongo.collection.Collection.distinct"><code class="xref py py-meth docutils literal notranslate"><span class="pre">distinct()</span></code></a></li>
<li>added <cite>database</cite> support for <a class="reference internal" href="api/bson/dbref.html#bson.dbref.DBRef" title="bson.dbref.DBRef"><code class="xref py py-class docutils literal notranslate"><span class="pre">DBRef</span></code></a></li>
<li>added <a class="reference internal" href="api/bson/json_util.html#module-bson.json_util" title="bson.json_util: Tools for using Python's json module with BSON documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">json_util</span></code></a> with helpers for encoding / decoding
special types to JSON</li>
<li>DEPRECATED <code class="xref py py-meth docutils literal notranslate"><span class="pre">pymongo.cursor.Cursor.__len__()</span></code> in favor of
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.count" title="pymongo.cursor.Cursor.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">count()</span></code></a> with <cite>with_limit_and_skip</cite> set
to <code class="docutils literal notranslate"><span class="pre">True</span></code> due to performance regression</li>
<li>switch documentation to Sphinx</li>
</ul>
</div>
<div class="section" id="changes-in-version-1-1">
<h2>Changes in Version 1.1<a class="headerlink" href="#changes-in-version-1-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>added <code class="xref py py-meth docutils literal notranslate"><span class="pre">__hash__()</span></code> for <a class="reference internal" href="api/bson/dbref.html#bson.dbref.DBRef" title="bson.dbref.DBRef"><code class="xref py py-class docutils literal notranslate"><span class="pre">DBRef</span></code></a> and
<a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a></li>
<li>bulk <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> works with any
iterable</li>
<li>fix <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a> generation when using
<code class="xref py py-mod docutils literal notranslate"><span class="pre">multiprocessing</span></code></li>
<li>added <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.collection" title="pymongo.cursor.Cursor.collection"><code class="xref py py-attr docutils literal notranslate"><span class="pre">collection</span></code></a></li>
<li>added <cite>network_timeout</cite> parameter for
<code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection()</span></code></li>
<li>DEPRECATED <cite>slave_okay</cite> parameter for individual queries</li>
<li>fix for <cite>safe</cite> mode when multi-threaded</li>
<li>added <cite>safe</cite> parameter for <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.remove" title="pymongo.collection.Collection.remove"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove()</span></code></a></li>
<li>added <cite>tailable</cite> parameter for <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a></li>
</ul>
</div>
<div class="section" id="changes-in-version-1-0">
<h2>Changes in Version 1.0<a class="headerlink" href="#changes-in-version-1-0" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>fixes for
<code class="xref py py-class docutils literal notranslate"><span class="pre">MasterSlaveConnection</span></code></li>
<li>added <cite>finalize</cite> parameter for <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a></li>
<li>improvements to <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> speed</li>
<li>improvements to <a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a> speed</li>
<li>added <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.__getitem__" title="pymongo.cursor.Cursor.__getitem__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__getitem__()</span></code></a> and
<code class="xref py py-meth docutils literal notranslate"><span class="pre">__len__()</span></code> for
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor" title="pymongo.cursor.Cursor"><code class="xref py py-class docutils literal notranslate"><span class="pre">Cursor</span></code></a> instances</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-16">
<h2>Changes in Version 0.16<a class="headerlink" href="#changes-in-version-0-16" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>support for encoding/decoding <code class="xref py py-class docutils literal notranslate"><span class="pre">uuid.UUID</span></code> instances</li>
<li>fix for <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.explain" title="pymongo.cursor.Cursor.explain"><code class="xref py py-meth docutils literal notranslate"><span class="pre">explain()</span></code></a> with limits</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-15-2">
<h2>Changes in Version 0.15.2<a class="headerlink" href="#changes-in-version-0-15-2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>documentation changes only</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-15-1">
<h2>Changes in Version 0.15.1<a class="headerlink" href="#changes-in-version-0-15-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>various performance improvements</li>
<li>API CHANGE no longer need to specify direction for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.create_index" title="pymongo.collection.Collection.create_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_index()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.ensure_index" title="pymongo.collection.Collection.ensure_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ensure_index()</span></code></a> when indexing a
single key</li>
<li>support for encoding <code class="xref py py-class docutils literal notranslate"><span class="pre">tuple</span></code> instances as <code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code>
instances</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-15">
<h2>Changes in Version 0.15<a class="headerlink" href="#changes-in-version-0-15" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>fix string representation of <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a>
instances</li>
<li>added <cite>timeout</cite> parameter for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a></li>
<li>allow scope for <cite>reduce</cite> function in
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a></li>
</ul>
</div>
<div class="section" id="changes-in-version-0-14-2">
<h2>Changes in Version 0.14.2<a class="headerlink" href="#changes-in-version-0-14-2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>minor bugfixes</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-14-1">
<h2>Changes in Version 0.14.1<a class="headerlink" href="#changes-in-version-0-14-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><code class="xref py py-meth docutils literal notranslate"><span class="pre">seek()</span></code> and
<code class="xref py py-meth docutils literal notranslate"><span class="pre">tell()</span></code> for (read mode)
<code class="xref py py-class docutils literal notranslate"><span class="pre">GridFile</span></code> instances</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-14">
<h2>Changes in Version 0.14<a class="headerlink" href="#changes-in-version-0-14" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>support for long in <a class="reference internal" href="api/bson/index.html#bson.BSON" title="bson.BSON"><code class="xref py py-class docutils literal notranslate"><span class="pre">BSON</span></code></a></li>
<li>added <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.rename" title="pymongo.collection.Collection.rename"><code class="xref py py-meth docutils literal notranslate"><span class="pre">rename()</span></code></a></li>
<li>added <cite>snapshot</cite> parameter for
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.find" title="pymongo.collection.Collection.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">find()</span></code></a></li>
</ul>
</div>
<div class="section" id="changes-in-version-0-13">
<h2>Changes in Version 0.13<a class="headerlink" href="#changes-in-version-0-13" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>better
<code class="xref py py-class docutils literal notranslate"><span class="pre">MasterSlaveConnection</span></code>
support</li>
<li>API CHANGE <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.insert" title="pymongo.collection.Collection.insert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">insert()</span></code></a> and
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.save" title="pymongo.collection.Collection.save"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save()</span></code></a> both return inserted
<code class="docutils literal notranslate"><span class="pre">_id</span></code></li>
<li>DEPRECATED passing an index name to
<a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.hint" title="pymongo.cursor.Cursor.hint"><code class="xref py py-meth docutils literal notranslate"><span class="pre">hint()</span></code></a></li>
</ul>
</div>
<div class="section" id="changes-in-version-0-12">
<h2>Changes in Version 0.12<a class="headerlink" href="#changes-in-version-0-12" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>improved <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a> generation</li>
<li>added <a class="reference internal" href="api/pymongo/errors.html#pymongo.errors.AutoReconnect" title="pymongo.errors.AutoReconnect"><code class="xref py py-class docutils literal notranslate"><span class="pre">AutoReconnect</span></code></a> exception for when
reconnection is possible</li>
<li>make <a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a> thread-safe</li>
<li>fix for <a class="reference internal" href="api/gridfs/index.html#module-gridfs" title="gridfs: Tools for working with GridFS"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gridfs</span></code></a> with non <a class="reference internal" href="api/bson/objectid.html#bson.objectid.ObjectId" title="bson.objectid.ObjectId"><code class="xref py py-class docutils literal notranslate"><span class="pre">ObjectId</span></code></a> <code class="docutils literal notranslate"><span class="pre">_id</span></code></li>
</ul>
</div>
<div class="section" id="changes-in-version-0-11-3">
<h2>Changes in Version 0.11.3<a class="headerlink" href="#changes-in-version-0-11-3" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>don’t allow NULL bytes in string encoder</li>
<li>fixes for Python 2.3</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-11-2">
<h2>Changes in Version 0.11.2<a class="headerlink" href="#changes-in-version-0-11-2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>PEP 8</li>
<li>updates for <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.group" title="pymongo.collection.Collection.group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">group()</span></code></a></li>
<li>VS build</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-11-1">
<h2>Changes in Version 0.11.1<a class="headerlink" href="#changes-in-version-0-11-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>fix for connection pooling under Python 2.5</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-11">
<h2>Changes in Version 0.11<a class="headerlink" href="#changes-in-version-0-11" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>better build failure detection</li>
<li>driver support for selecting fields in sub-documents</li>
<li>disallow insertion of invalid key names</li>
<li>added <cite>timeout</cite> parameter for <code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection()</span></code></li>
</ul>
</div>
<div class="section" id="changes-in-version-0-10-3">
<h2>Changes in Version 0.10.3<a class="headerlink" href="#changes-in-version-0-10-3" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>fix bug with large <a class="reference internal" href="api/pymongo/cursor.html#pymongo.cursor.Cursor.limit" title="pymongo.cursor.Cursor.limit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">limit()</span></code></a></li>
<li>better exception when modules get reloaded out from underneath the C
extension</li>
<li>better exception messages when calling a
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a> or
<a class="reference internal" href="api/pymongo/database.html#pymongo.database.Database" title="pymongo.database.Database"><code class="xref py py-class docutils literal notranslate"><span class="pre">Database</span></code></a> instance</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-10-2">
<h2>Changes in Version 0.10.2<a class="headerlink" href="#changes-in-version-0-10-2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>support subclasses of <code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code> in C encoder</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-10-1">
<h2>Changes in Version 0.10.1<a class="headerlink" href="#changes-in-version-0-10-1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>alias <code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code> as
<code class="xref py py-attr docutils literal notranslate"><span class="pre">pymongo.Connection</span></code></li>
<li>raise an exception rather than silently overflowing in encoder</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-10">
<h2>Changes in Version 0.10<a class="headerlink" href="#changes-in-version-0-10" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>added <a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection.ensure_index" title="pymongo.collection.Collection.ensure_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ensure_index()</span></code></a></li>
</ul>
</div>
<div class="section" id="changes-in-version-0-9-7">
<h2>Changes in Version 0.9.7<a class="headerlink" href="#changes-in-version-0-9-7" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>allow sub-collections of <em>$cmd</em> as valid
<a class="reference internal" href="api/pymongo/collection.html#pymongo.collection.Collection" title="pymongo.collection.Collection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collection</span></code></a> names</li>
<li>add version as <a class="reference internal" href="api/pymongo/index.html#pymongo.version" title="pymongo.version"><code class="xref py py-attr docutils literal notranslate"><span class="pre">pymongo.version</span></code></a></li>
<li>add <code class="docutils literal notranslate"><span class="pre">--no_ext</span></code> command line option to <em>setup.py</em></li>
</ul>
<div class="toctree-wrapper compound">
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Changelog</a><ul>
<li><a class="reference internal" href="#changes-in-version-3-7-2">Changes in Version 3.7.2</a><ul>
<li><a class="reference internal" href="#issues-resolved">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-7-1">Changes in Version 3.7.1</a><ul>
<li><a class="reference internal" href="#id1">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-7-0">Changes in Version 3.7.0</a><ul>
<li><a class="reference internal" href="#id2">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-6-1">Changes in Version 3.6.1</a><ul>
<li><a class="reference internal" href="#id3">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-6-0">Changes in Version 3.6.0</a><ul>
<li><a class="reference internal" href="#id4">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-5-1">Changes in Version 3.5.1</a><ul>
<li><a class="reference internal" href="#id5">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-5">Changes in Version 3.5</a><ul>
<li><a class="reference internal" href="#id6">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-4">Changes in Version 3.4</a><ul>
<li><a class="reference internal" href="#id7">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-3-1">Changes in Version 3.3.1</a><ul>
<li><a class="reference internal" href="#id8">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-3">Changes in Version 3.3</a><ul>
<li><a class="reference internal" href="#id9">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-2-2">Changes in Version 3.2.2</a><ul>
<li><a class="reference internal" href="#id10">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-2-1">Changes in Version 3.2.1</a><ul>
<li><a class="reference internal" href="#id11">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-2">Changes in Version 3.2</a><ul>
<li><a class="reference internal" href="#id12">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-1-1">Changes in Version 3.1.1</a><ul>
<li><a class="reference internal" href="#id13">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-1">Changes in Version 3.1</a><ul>
<li><a class="reference internal" href="#changes-in-internal-classes">Changes in internal classes</a></li>
<li><a class="reference internal" href="#id14">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-0-3">Changes in Version 3.0.3</a><ul>
<li><a class="reference internal" href="#id15">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-0-2">Changes in Version 3.0.2</a><ul>
<li><a class="reference internal" href="#id16">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-0-1">Changes in Version 3.0.1</a><ul>
<li><a class="reference internal" href="#id17">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-3-0">Changes in Version 3.0</a><ul>
<li><a class="reference internal" href="#sonmanipulator-changes">SONManipulator changes</a></li>
<li><a class="reference internal" href="#ssl-tls-changes">SSL/TLS changes</a></li>
<li><a class="reference internal" href="#gevent-support">Gevent Support</a></li>
<li><a class="reference internal" href="#mongoclient-changes"><code class="docutils literal notranslate"><span class="pre">MongoClient</span></code> changes</a></li>
<li><a class="reference internal" href="#cursor-changes"><code class="docutils literal notranslate"><span class="pre">Cursor</span></code> changes</a></li>
<li><a class="reference internal" href="#cursor-management-changes">Cursor management changes</a></li>
<li><a class="reference internal" href="#database-changes"><code class="docutils literal notranslate"><span class="pre">Database</span></code> changes</a></li>
<li><a class="reference internal" href="#collection-changes"><code class="docutils literal notranslate"><span class="pre">Collection</span></code> changes</a><ul>
<li><a class="reference internal" href="#changes-to-find-and-find-one">Changes to <code class="docutils literal notranslate"><span class="pre">find()</span></code> and <code class="docutils literal notranslate"><span class="pre">find_one()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#errors-changes"><code class="docutils literal notranslate"><span class="pre">errors</span></code> changes</a></li>
<li><a class="reference internal" href="#gridfs-changes"><code class="docutils literal notranslate"><span class="pre">gridfs</span></code> changes</a></li>
<li><a class="reference internal" href="#bson-changes"><code class="docutils literal notranslate"><span class="pre">bson</span></code> changes</a></li>
<li><a class="reference internal" href="#id18">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-9-5">Changes in Version 2.9.5</a><ul>
<li><a class="reference internal" href="#id19">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-9-4">Changes in Version 2.9.4</a><ul>
<li><a class="reference internal" href="#id20">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-9-3">Changes in Version 2.9.3</a><ul>
<li><a class="reference internal" href="#id21">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-9-2">Changes in Version 2.9.2</a><ul>
<li><a class="reference internal" href="#id22">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-9-1">Changes in Version 2.9.1</a><ul>
<li><a class="reference internal" href="#id23">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-9">Changes in Version 2.9</a><ul>
<li><a class="reference internal" href="#id24">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-8-1">Changes in Version 2.8.1</a><ul>
<li><a class="reference internal" href="#id25">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-8">Changes in Version 2.8</a><ul>
<li><a class="reference internal" href="#id26">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-7-2">Changes in Version 2.7.2</a><ul>
<li><a class="reference internal" href="#id27">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-7-1">Changes in Version 2.7.1</a><ul>
<li><a class="reference internal" href="#id28">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-7">Changes in Version 2.7</a><ul>
<li><a class="reference internal" href="#breaking-changes">Breaking changes</a></li>
<li><a class="reference internal" href="#id29">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-6-3">Changes in Version 2.6.3</a><ul>
<li><a class="reference internal" href="#id30">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-6-2">Changes in Version 2.6.2</a><ul>
<li><a class="reference internal" href="#id31">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-6-1">Changes in Version 2.6.1</a><ul>
<li><a class="reference internal" href="#id32">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-6">Changes in Version 2.6</a><ul>
<li><a class="reference internal" href="#id33">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-5-2">Changes in Version 2.5.2</a><ul>
<li><a class="reference internal" href="#id34">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-5-1">Changes in Version 2.5.1</a><ul>
<li><a class="reference internal" href="#id35">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-5">Changes in Version 2.5</a><ul>
<li><a class="reference internal" href="#id36">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-4-2">Changes in Version 2.4.2</a><ul>
<li><a class="reference internal" href="#id37">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-4-1">Changes in Version 2.4.1</a><ul>
<li><a class="reference internal" href="#id38">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-4">Changes in Version 2.4</a><ul>
<li><a class="reference internal" href="#id39">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-3">Changes in Version 2.3</a><ul>
<li><a class="reference internal" href="#id40">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-2-1">Changes in Version 2.2.1</a><ul>
<li><a class="reference internal" href="#id41">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-2">Changes in Version 2.2</a><ul>
<li><a class="reference internal" href="#id42">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-1-1">Changes in Version 2.1.1</a><ul>
<li><a class="reference internal" href="#id43">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-1">Changes in Version 2.1</a><ul>
<li><a class="reference internal" href="#id44">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-0-1">Changes in Version 2.0.1</a><ul>
<li><a class="reference internal" href="#id45">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-2-0">Changes in Version 2.0</a><ul>
<li><a class="reference internal" href="#id46">Issues Resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-1-11">Changes in Version 1.11</a><ul>
<li><a class="reference internal" href="#id47">Issues resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-1-10-1">Changes in Version 1.10.1</a><ul>
<li><a class="reference internal" href="#id48">Issues resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-1-10">Changes in Version 1.10</a><ul>
<li><a class="reference internal" href="#id49">Issues resolved</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-1-9">Changes in Version 1.9</a></li>
<li><a class="reference internal" href="#changes-in-version-1-8-1">Changes in Version 1.8.1</a></li>
<li><a class="reference internal" href="#changes-in-version-1-8">Changes in Version 1.8</a></li>
<li><a class="reference internal" href="#changes-in-version-1-7">Changes in Version 1.7</a></li>
<li><a class="reference internal" href="#changes-in-version-1-6">Changes in Version 1.6</a></li>
<li><a class="reference internal" href="#changes-in-version-1-5-2">Changes in Version 1.5.2</a></li>
<li><a class="reference internal" href="#changes-in-version-1-5-1">Changes in Version 1.5.1</a></li>
<li><a class="reference internal" href="#changes-in-version-1-5">Changes in Version 1.5</a></li>
<li><a class="reference internal" href="#changes-in-version-1-4">Changes in Version 1.4</a></li>
<li><a class="reference internal" href="#changes-in-version-1-3">Changes in Version 1.3</a></li>
<li><a class="reference internal" href="#changes-in-version-1-2-1">Changes in Version 1.2.1</a></li>
<li><a class="reference internal" href="#changes-in-version-1-2">Changes in Version 1.2</a></li>
<li><a class="reference internal" href="#changes-in-version-1-1-2">Changes in Version 1.1.2</a></li>
<li><a class="reference internal" href="#changes-in-version-1-1-1">Changes in Version 1.1.1</a></li>
<li><a class="reference internal" href="#changes-in-version-1-1">Changes in Version 1.1</a></li>
<li><a class="reference internal" href="#changes-in-version-1-0">Changes in Version 1.0</a></li>
<li><a class="reference internal" href="#changes-in-version-0-16">Changes in Version 0.16</a></li>
<li><a class="reference internal" href="#changes-in-version-0-15-2">Changes in Version 0.15.2</a></li>
<li><a class="reference internal" href="#changes-in-version-0-15-1">Changes in Version 0.15.1</a></li>
<li><a class="reference internal" href="#changes-in-version-0-15">Changes in Version 0.15</a></li>
<li><a class="reference internal" href="#changes-in-version-0-14-2">Changes in Version 0.14.2</a></li>
<li><a class="reference internal" href="#changes-in-version-0-14-1">Changes in Version 0.14.1</a></li>
<li><a class="reference internal" href="#changes-in-version-0-14">Changes in Version 0.14</a></li>
<li><a class="reference internal" href="#changes-in-version-0-13">Changes in Version 0.13</a></li>
<li><a class="reference internal" href="#changes-in-version-0-12">Changes in Version 0.12</a></li>
<li><a class="reference internal" href="#changes-in-version-0-11-3">Changes in Version 0.11.3</a></li>
<li><a class="reference internal" href="#changes-in-version-0-11-2">Changes in Version 0.11.2</a></li>
<li><a class="reference internal" href="#changes-in-version-0-11-1">Changes in Version 0.11.1</a></li>
<li><a class="reference internal" href="#changes-in-version-0-11">Changes in Version 0.11</a></li>
<li><a class="reference internal" href="#changes-in-version-0-10-3">Changes in Version 0.10.3</a></li>
<li><a class="reference internal" href="#changes-in-version-0-10-2">Changes in Version 0.10.2</a></li>
<li><a class="reference internal" href="#changes-in-version-0-10-1">Changes in Version 0.10.1</a></li>
<li><a class="reference internal" href="#changes-in-version-0-10">Changes in Version 0.10</a></li>
<li><a class="reference internal" href="#changes-in-version-0-9-7">Changes in Version 0.9.7</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="contributors.html"
                        title="previous chapter">Contributors</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="python3.html"
                        title="next chapter">Python 3 FAQ</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/changelog.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="python3.html" title="Python 3 FAQ"
             >next</a> |</li>
        <li class="right" >
          <a href="contributors.html" title="Contributors"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">PyMongo 3.7.2 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright MongoDB, Inc. 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
    </div>
  </body>
</html>