SOLUTION for: mongoengine + marshmallow
If you use mongoengine
and marshamallow
then this solution might be applicable for you.
Basically, I imported String
field from marshmallow, and I overwritten default Schema id
to be String
encoded.
from marshmallow import Schema
from marshmallow.fields import String
class FrontendUserSchema(Schema):
id = String()
class Meta:
fields = ("id", "email")