I am surprised this question has still not been answered. And though this might not be the exact answer you are looking for, here is my take on things. I have found that using the second approach, MongoFactoryBean
, is the best approach.
Simply because there are more configuration options. For instance, if you want to set an Exception Translator, you can do so easily with MongoFactoryBean
.
If I remember correctly, and I may be wrong, the MongoFactoryBean is meant for convenience for MongoDbFactory
. Meaning, it adds another layer of abstraction.
All in all, go with the second approach.