如果模型包含 ListField(db.ReferenceField)) 并且在查询后调用to_json()
ir 不会将孩子转换为 json,只需将其保留为 OID。有没有办法轻松地将孩子(至少到 X 深层次)转换为 json?
"data": {
"articles": [],
"category": {
"_id": {
"$oid": "5224905453f0462f5458a724"
},
"children": [
{
"$oid": "5224905453f0462f5458a725"
},
{
"$oid": "5224905453f0462f5458a726"
},
{
"$oid": "5224905453f0462f5458a727"
},
{
"$oid": "5224905453f0462f5458a728"
}
],
...........