I am new to MongoDB and trying to create a simple schema for a collection of python objects. I find it difficult to work with the concept of polymorphism.
Below is some pseudo code. How do you represent this inheritance hierarchy in the MongoDB schema:
class A: content = 'video' or 'image' or 'music' data = contentData
The problem I am facing is that the A.data schema is dependent on A.content. How can one represent A in a mongodb scheme?
source share