My requirement is that I have to write a service in Spring to fetch all attributes of a collection in Mongo. The solutions that I've found explain how to get attributes using mongo shell.
Using map/reduce for mapping the properties in a collection
Now I want to do the same thing in programmatic way in Java, How should I do it?