Bidirectional references in MongoEngine

228 views Asked by At

PHP Doctrine has support for bi-directional references. I wonder if MongoEngine has something similar to this, so that when, for example, I add a post of a user, I don't need to manually keep both sides synced.

I could also only store the reference on the many side of a one-to-many relationship, and use something like Post(user=user_a) to get user_a's all posts. But I would like to know the trade-offs of the two approaches. Also, how about many-to-many relationships?

Much appreciated!

0

There are 0 answers