0

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:

  1. How do I use one to many to link these schemas using pymongo or motor?
  2. How do I represent that in pydantic model too?
AlexisG
  • 2,476
  • 3
  • 11
  • 25

0 Answers0