[Fixed]-Python+django trying to serialize mongoengine documents to json but getting only arrays of fields names

1👍

I found the solution… Unfortunatelly the MongoEngine’s documentation is still growing…

They provided a method to_json() to the documents.

So:

dados = Estados.objects.exclude('Cidades').all().to_json()

Leave a comment