I am new to MongoDB. I am preparing an example for training. It seems that when working with bidirectional relationships with Spring Data and DBRef, it goes into a loop endlessly and continues to read the connection again and again.
Domain class looks like
class Category{ private String name; private Category parentCategory; private Set<Category> childCategories;
I wonder if this is a rare scenario, to have this kind of bi-directional relationship (quite often in ORM, though), could not get any help with this. One option would be to write a custom converter and ignore either side of the relationship, but that will turn my memory object into an inconsistent state.
Please share ideas about this or some of the best practices for handling such scenarios.
Thanks, Vishal Shukla
source share