To support multi-document transactions, I had to make breaking changes to Motor’s session API and release a major version bump, Motor 2.0. Since this is a major release I also deleted many helper methods and APIs that had been deprecated over time since Motor 1.0, most notably the old CRUD methods
save, and the original callback-based API. Read the Motor 2.0 Migration Guide carefully to upgrade your existing Motor application. Motor 2.0 also includes a Python 3.7 compatibility fix in the MotorChangeStream class returned by MotorCollection.watch.
Motor 2.0’s changes have a big impact for some applications, so I created a bridge release that raises DeprecationWarning for all the APIs that are deleted in Motor 2.0, especially the callback API, which hasn’t been deprecated before. Those DeprecationWarnings plus the Python 3.7 compatibility fix constitute Motor 1.3.1.
For applications that only need Python 3.7 compatibility, I’ve created Motor 1.2.5, which includes the Python 3.7 fix and no other changes.
Detailed release notes follow.
Motor 2.0 drops support for MongoDB 2.6 and adds MongoDB 4.0 features, including multi-document transactions, and change stream notifications on entire databases or entire MongoDB servers. This version of Motor requires PyMongo 3.7 or later.
Added support for aiohttp 3.0 and later, and dropped older aiohttp versions. The aiohttp integration now requires Python 3.5+.
This is a major release that removes previously deprecated APIs.
The MotorDatabase.add_user and MotorDatabase.remove_user methods are deleted. Manage user accounts with four database commands: createUser, usersInfo, updateUser, and dropUser. You can run any database command with the MotorDatabase.command() method.
- New methods for retrieving batches of raw BSON:
- Motor adds its name, version, and Tornado’s version (if appropriate) to the client data logged by the MongoDB server when Motor connects, in addition to the data added by PyMongo.
- Calling batch_size() on a cursor returned from aggregate() no longer raises AttributeError.
Deprecate Motor’s old callback-based async API in preparation for removing it in Motor 2.0. Raise DeprecationWarning whenever a callback is passed.
If you find issues, file a bug and I’ll respond promptly. But if it works for you, don’t be silent!—tweet at me and tell me.