I am very upset when I try to request the results of the Mongolian criteria and save only documents in which the field is different. And by doing this:
Books.all.distinct(:name)
.. returns only name fields, not documents.
Also using a loop uniq, as pointed out in another question, doesn't work here.
Books.all.uniq{|x| x.name}
What am I missing here?
source
share