Please, can some show me how to do this in fastapi?
Sample collections
User Collection:
{
"_id" : "object ID",
"name": " str",
"email": " str"
}
UserProfile Collection:
{
"_id" : "object ID",
"first_name": "str",
"last_name": "str"
}
Company Collection:
{
"_id" : "object ID",
" name" : "str",
" dept" : "str"
}
Questions:
- How do I use one to many to link these schemas using pymongo or motor?
- How do I represent that in pydantic model too?