How do I get mongoDB to return a list of non-duplicate documents.
In my case, the mongoDB returns a list of ingredients from all the recipes registered, but I want those records without duplication because the recipes can repeat the same ingredients. How can I solve this problem?
List<Datasheet> datasheets =
getDatastore().find(Datasheet.class).retrievedFields(true, "ingredients").asList();