MotorConnection Has Been Renamed MotorClient
As it was foretold, so has it come to pass. The omens all are satisfied, the prophecy fulfilled.
Last month I wrote about PyMongo renaming its main classes from Connection
to MongoClient
and from ReplicaSetConnection
to MongoReplicaSetClient
. For consistency, I promised to rename Motor's main classes, too: from MotorConnection
to MotorClient
and from MotorReplicaSetConnection
to MotorReplicaSetClient
. Now I've done so.
Migration
- Obviously, anywhere you refer to
MotorConnection
orMotorReplicaSetConnection
, replace it withMotorClient
orMotorReplicaSetClient
. - More subtly, if you use the
sync_connection
method, that's changed tosync_client
.
I've updated this blog to run on the latest version of Motor, you can see the commit here.