You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to use pymongo-migrate in a project using mongo-engine, unfortunately your MongoMigrate class doesn't really play nice with that.
After taking a look at the source, I noticed MongoMigrate only really uses a database. The client passed for initialisation is only used to get the default database.
In my case, the client I can get from mongoengine with get_connection() doesn't have a default database and the code raises an exception. However I can get the database I want with get_db().
So I thought MongoMigrate should rather take the db as a constructor argument and maybe provide a classmethod to init from a pymongo.MongoClient.
I can work on a PR if you're okay with that.
The text was updated successfully, but these errors were encountered:
We are trying to use
pymongo-migrate
in a project usingmongo-engine
, unfortunately yourMongoMigrate
class doesn't really play nice with that.After taking a look at the source, I noticed
MongoMigrate
only really uses a database. The client passed for initialisation is only used to get the default database.In my case, the client I can get from
mongoengine
withget_connection()
doesn't have a default database and the code raises an exception. However I can get the database I want withget_db()
.So I thought
MongoMigrate
should rather take thedb
as a constructor argument and maybe provide aclassmethod
to init from apymongo.MongoClient
.I can work on a PR if you're okay with that.
The text was updated successfully, but these errors were encountered: