emmett-framework / emmett

The web framework for inventors
Other
1.04k stars 70 forks source link

MongoDB support #294

Closed josejachuf closed 3 years ago

josejachuf commented 3 years ago

Hi, I was trying to use mongodb, but an error occurs when applying a migration (migrations up) with the following error:

[Blank database, just created]

venv38/lib/python3.8/site-packages/pymongo/helpers.py", line 167, in _check_command_response raise OperationFailure(msg % errmsg, code, response, pymongo.errors.OperationFailure: Failed to parse: { find: "emmett_schema", filter: { _id: { $gt: ObjectId('000000000000000000000000') } }, snapshot: false, projection: { id: "_id", version: "version" }, lsid: { id: UUID("2eb7a359-6ca0-4503-b505-1bf47bff61ff") }, $db: "mydb", $readPreference: { mode: "primaryPreferred" } }. Unrecognized field 'snapshot'., full error: {'ok': 0.0, 'errmsg': 'Failed to parse: { find: "emmett_schema", filter: { _id: { $gt: ObjectId(\'000000000000000000000000\') } }, snapshot: false, projection: { id: "_id", version: "version" }, lsid: { id: UUID("2eb7a359-6ca0-4503-b505-1bf47bff61ff") }, $db: "mydb", $readPreference: { mode: "primaryPreferred" } }. Unrecognized field \'snapshot\'.', 'code': 9, 'codeName': 'FailedToParse'}

Jose

gi0baro commented 3 years ago

@josejachuf probably I should improve the migrations docs, because MongoDB is not supported by Emmett's migration system (and there are no plans to add this kind of support in future).

FYI: there's actually this personal repository with a Work In Progress wrapper around pymongo, but it's not using any ORM. In case you wondering why: it is actually used by this REST implementation which is a Work In Progress as well. No idea if it sounds interesting for your specific needs.

josejachuf commented 3 years ago

Thanks @gi0baro