NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #323 most downloaded on PyPI
PyMongo - the Official MongoDB Python driver
Last release 10 days ago
10 Sep 2026
Release timing varies
gaps range from 8 days to 4 months
Nearly every release is documented
notes for 56 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
18 years old
172 releases · first in 2009
added _id property for GridFile instances.
added _id property for GridFile instances.
fix for making a Connection (with slave_okay set) directly to a slave in a replica pair.
accept kwargs for create_index() and ensure_index() to support all indexing options.
add pymongo.GEO2D and support for geo indexing.
improvements to Python code caching in C extension - should improve behavior on mod_wsgi.
DEPRECATED options argument to Collection() and create_collection() in favor of kwargs.
added subtype constants to binary module.
DEPRECATED options argument to Collection() and create_collection() in favor of kwargs.
added has_c() to check for C extension.
added copy_database() .
added alive to tell when a cursor might have more data to return (useful for tailable cursors).
added Timestamp to better support dealing with internal MongoDB timestamps.
added name argument for create_index() and ensure_index() .
fixed connection pooling w/ fork
paired() takes all kwargs that are allowed for Connection() .
insert() returns list for bulk inserts of size one.
fixed handling of datetime.datetime instances in json_util .
added from_uri() to support MongoDB connection uri scheme.
fixed chunk number calculation when unaligned in gridfs .
command() takes a string for simple commands.
added system_js helper for dealing with server-side JS.
don’t wrap queries containing "$query" (support manual use of "$min" , etc.).
added GridFSError as base class for gridfs exceptions.
One column per quarter.
added PyMongoError as base exception class for all errors . this changes the exception hierarchy somewhat, and is a BREAKING change if you depend on C…
Perhaps the most important change in version 1.4 is that we have decided to no longer support Python 2.3 . 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.
Other changes:
move "_id" to front only for top-level documents (fixes some corner cases).
update() and remove() return the entire response to the lastError command when safe is True .
completed removal of things that were deprecated in version 1.2 or earlier.
enforce that collection names do not contain the NULL byte.
fix to allow using UTF-8 collection names with the C extension.
added PyMongoError as base exception class for all errors . this changes the exception hierarchy somewhat, and is a BREAKING change if you depend on ConnectionFailure being a IOError or InvalidBSON being a ValueError , for example.
added DuplicateKeyError for calls to insert() or update() with safe set to True .
removed thread_util .
added add_user() and remove_user() helpers.
fix for authenticate() when using non-UTF-8 names or passwords.
minor fixes for MasterSlaveConnection .
clean up all cases where ConnectionFailure is raised.
simplification of connection pooling - makes driver ~2x faster for simple benchmarks. see How does connection pooling work in PyMongo? for more information.
DEPRECATED pool_size , auto_start_request and timeout parameters to Connection . DEPRECATED start_request() .
use socket.sendall() .
removed from_xml() as it was only being used for some internal testing - also eliminates dependency on elementtree .
implementation of update() in C.
deprecate _command() in favor of command() .
send all commands without wrapping as {"query": ...} .
support string as key argument to group() (keyf) and run all groups as commands.
support for equality testing for Code instances.
allow the NULL byte in strings and disallow it in key names or regex patterns
DEPRECATED running group() as eval() , also changed default for group() to running as a command
DEPRECATED running group() as eval() , also changed default for group() to running as a command
remove pymongo.cursor.Cursor.len() , which was deprecated in 1.1.1 - needed to do this aggressively due to it’s presence breaking Django template for loops
DEPRECATED host() , port() , connection() , name() , database() , name() and full_name() in favor of host , port , connection , name , database , name and full_name , respectively. The deprecation schedule for this change will probably be faster than usual, as it carries some performance implications.
added disconnect()
added setup.py doc --test to run doctests for tutorial, examples
added Changelog to docs
added setup.py doc --test to run doctests for tutorial, examples
moved most examples to Sphinx docs (and remove from examples/ directory)
raise InvalidId instead of TypeError when passing a 24 character string to ObjectId that contains non-hexadecimal characters
allow unicode instances for ObjectId init
DEPRECATED url_encode() and url_decode() in favor of str() and ObjectId() , respectively
spec parameter for remove() is now optional to allow for deleting all documents in a Collection
always wrap queries with {query: ...} even when no special options - get around some issues with queries on fields named query
enforce 4MB document limit on the client side
added map_reduce() helper - see example
added distinct() method on Cursor instances to allow distinct with queries
fix for getitem() after skip()
allow any UTF-8 string in BSON encoder, not just ASCII subset
added generation_time
removed support for legacy ObjectId format - pretty sure this was never used, and is just confusing
DEPRECATED url_encode() and url_decode() in favor of str() and ObjectId() , respectively
allow oplog.$main as a valid collection name
some minor fixes for installation process
added support for datetime and regex in json_util
improvements to insert() speed (using C for insert message creation)
improvements to insert() speed (using C for insert message creation)
use random number for request_id
fix some race conditions with AutoReconnect
DEPRECATED pymongo.cursor.Cursor.__len__() in favor of count() with with_limit_and_skip set to True due to performance regression
added multi parameter for update()
fix unicode regex patterns with C extension
added distinct()
added database support for DBRef
added json_util with helpers for encoding / decoding special types to JSON
DEPRECATED pymongo.cursor.Cursor.len() in favor of count() with with_limit_and_skip set to True due to performance regression
switch documentation to Sphinx
DEPRECATED slave_okay parameter for individual queries
added hash() for DBRef and ObjectId
bulk insert() works with any iterable
fix ObjectId generation when using multiprocessing
added collection
added network_timeout parameter for Connection()
DEPRECATED slave_okay parameter for individual queries
fix for safe mode when multi-threaded
added safe parameter for remove()
added tailable parameter for find()
fixes for MasterSlaveConnection
fixes for MasterSlaveConnection
added finalize parameter for group()
improvements to insert() speed
improvements to gridfs speed
added getitem() and len() for Cursor instances
support for encoding/decoding uuid.UUID instances
support for encoding/decoding uuid.UUID instances
fix for explain() with limits
- documentation changes only
various performance improvements
various performance improvements
API CHANGE no longer need to specify direction for create_index() and ensure_index() when indexing a single key
support for encoding tuple instances as list instances
fix string representation of ObjectId instances
fix string representation of ObjectId instances
added timeout parameter for find()
allow scope for reduce function in group()
- minor bugfixes
seek() and tell() for (read mode) GridFile instances
added snapshot parameter for find()
support for long in BSON
added rename()
added snapshot parameter for find()
DEPRECATED passing an index name to hint()
better MasterSlaveConnection support
API CHANGE insert() and save() both return inserted _id
DEPRECATED passing an index name to hint()
added AutoReconnect exception for when reconnection is possible
improved ObjectId generation
added AutoReconnect exception for when reconnection is possible
make gridfs thread-safe
fix for gridfs with non ObjectId _id
don’t allow NULL bytes in string encoder
don’t allow NULL bytes in string encoder
fixes for Python 2.3
- PEP 8 - updates for group() - VS build
PEP 8
updates for group()
VS build
fix for connection pooling under Python 2.5
driver support for selecting fields in sub-documents
better build failure detection
driver support for selecting fields in sub-documents
disallow insertion of invalid key names
added timeout parameter for Connection()
better exception when modules get reloaded out from underneath the C extension
fix bug with large limit()
better exception when modules get reloaded out from underneath the C extension
better exception messages when calling a Collection or Database instance
support subclasses of dict in C encoder
alias Connection as pymongo.Connection
alias Connection as pymongo.Connection
raise an exception rather than silently overflowing in encoder
- added ensure_index()
allow sub-collections of $cmd as valid Collection names
allow sub-collections of $cmd as valid Collection names
add version as pymongo.version
add --no_ext command line option to setup.py
Changelog
Changes in Version 3.10.0
Issues Resolved
Changes in Version 3.9.0
Issues Resolved
Changes in Version 3.8.0
Issues Resolved
Changes in Version 3.7.2
Issues Resolved
Changes in Version 3.7.1
Issues Resolved
Changes in Version 3.7.0
Issues Resolved
Changes in Version 3.6.1
Issues Resolved
Changes in Version 3.6.0
Issues Resolved
Changes in Version 3.5.1
Issues Resolved
Changes in Version 3.5
Issues Resolved
Changes in Version 3.4
Issues Resolved
Changes in Version 3.3.1
Issues Resolved
Changes in Version 3.3
Issues Resolved
Changes in Version 3.2.2
Issues Resolved
Changes in Version 3.2.1
Issues Resolved
Changes in Version 3.2
Issues Resolved
Changes in Version 3.1.1
Issues Resolved
Changes in Version 3.1
Changes in internal classes
Issues Resolved
Changes in Version 3.0.3
Issues Resolved
Changes in Version 3.0.2
Issues Resolved
Changes in Version 3.0.1
Issues Resolved
Changes in Version 3.0
SONManipulator changes
SSL/TLS changes
Gevent Support
MongoClient changes
Cursor changes
Cursor management changes
Database changes
Collection changes
Changes to find() and find_one()
errors changes
gridfs changes
bson changes
Issues Resolved
Changes in Version 2.9.5
Issues Resolved
Changes in Version 2.9.4
Issues Resolved
Changes in Version 2.9.3
Issues Resolved
Changes in Version 2.9.2
Issues Resolved
Changes in Version 2.9.1
Issues Resolved
Changes in Version 2.9
Issues Resolved
Changes in Version 2.8.1
Issues Resolved
Changes in Version 2.8
Issues Resolved
Changes in Version 2.7.2
Issues Resolved
Changes in Version 2.7.1
Issues Resolved
Changes in Version 2.7
Breaking changes
Issues Resolved
Changes in Version 2.6.3
Issues Resolved
Changes in Version 2.6.2
Issues Resolved
Changes in Version 2.6.1
Issues Resolved
Changes in Version 2.6
Issues Resolved
Changes in Version 2.5.2
Issues Resolved
Changes in Version 2.5.1
Issues Resolved
Changes in Version 2.5
Issues Resolved
Changes in Version 2.4.2
Issues Resolved
Changes in Version 2.4.1
Issues Resolved
Changes in Version 2.4
Issues Resolved
Changes in Version 2.3
Issues Resolved
Changes in Version 2.2.1
Issues Resolved
Changes in Version 2.2
Issues Resolved
Changes in Version 2.1.1
Issues Resolved
Changes in Version 2.1
Issues Resolved
Changes in Version 2.0.1
Issues Resolved
Changes in Version 2.0
Issues Resolved
Changes in Version 1.11
Issues resolved
Changes in Version 1.10.1
Issues resolved
Changes in Version 1.10
Issues resolved
Changes in Version 1.9
Changes in Version 1.8.1
Changes in Version 1.8
Changes in Version 1.7
Changes in Version 1.6
Changes in Version 1.5.2
Changes in Version 1.5.1
Changes in Version 1.5
Changes in Version 1.4
Changes in Version 1.3
Changes in Version 1.2.1
Changes in Version 1.2
Changes in Version 1.1.2
Changes in Version 1.1.1
Changes in Version 1.1
Changes in Version 1.0
Changes in Version 0.16
Changes in Version 0.15.2
Changes in Version 0.15.1
Changes in Version 0.15
Changes in Version 0.14.2
Changes in Version 0.14.1
Changes in Version 0.14
Changes in Version 0.13
Changes in Version 0.12
Changes in Version 0.11.3
Changes in Version 0.11.2
Changes in Version 0.11.1
Changes in Version 0.11
Changes in Version 0.10.3
Changes in Version 0.10.2
Changes in Version 0.10.1
Changes in Version 0.10
Changes in Version 0.9.7
Contributors
Python 3 FAQ
index
modules |
next |
previous |
PyMongo 3.10.0 documentation »
© Copyright MongoDB, Inc. 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →