This is usually how I handle it,
from bson import json_util, ObjectId
import json
#Dump loaded BSON to valid JSON string and reload it as dict
page_sanitized = json.loads(json_util.dumps(page))
return page_sanitized
This is usually how I handle it,
from bson import json_util, ObjectId
import json
#Dump loaded BSON to valid JSON string and reload it as dict
page_sanitized = json.loads(json_util.dumps(page))
return page_sanitized