Helpful note to everyone, who wants MongoEngine to serialize JSON like this:
{ "id": "5f0b54728a42acf154e2082d", // the rest of document }
not this:
{ "_id": { "$oid": "5f0b54728a42acf154e2082d" } // ... the rest of document }
Install MongoEngine GoodJSON library and extend Movie class like this:
Movie
from .db import db import mongoengine_goodjson as gj class Movie(gj.Document): #the rest of code here ...
Wow, that's cool. Thank you. I was doing manual normalization, but this looks awesome.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Helpful note to everyone, who wants MongoEngine to serialize JSON like this:
not this:
Install MongoEngine GoodJSON library and extend
Movie
class like this:Wow, that's cool. Thank you.
I was doing manual normalization, but this looks awesome.