I am pretty new to mongo db, and I have a simple question regarding a trouble I can’t solve in my Java program (3.0.2 client version). My aim is to perform a distinct on the “cars” test database, and I am trying this code:
DistinctIterable<Object> classification = collection.distinct("classification", null);
I can’t figure out what should I put in the second parameter. Could you help me please?
If you are using the Java API, I think that you can pass just the first argument, that would be the one on which do the distinct. The second parameter would be the query to filter on, but it can be omitted according to the documentation.