How can I get id instead of _id? #939
Unanswered
resulyrt93
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to get id fields as
id
instead of_id
but I couldn't find any solution about it. I checked following issues but probably they are valid for pydantic v1.id
, not_id
#144My stack
pydantic==2.7.1
beanie==1.25.0
fastapi==0.111.0
Also there is an strange situation about id field. If response has a relational field, id field which is in relation object, returns as
id
unlike root id. I think it's a little bit confusing for API clients.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions