While I was thinking about my problem, I came up with a solution.
I just add the identifier of my reference class to my model.
Here is an example:
class MyClass(Document): ... other_classes = ListField(ReferenceField(Other_Class)) class Other_Class(Document): myclass = ReferenceField(MyClass)
I'm not quite sure that this is a Mongolian way of doing this, but I'm sure it works :)
You can optionally omit the other_classes attribute in MyClass to avoid redundancy, but then you need a query like this to get the "children" objects:
Other_Class.objects(myclass = myclass.id)
source share