I am working on a project that uses a mongoDB database to store and extract data from. I currently have a situation where I want to query all documents (with specific conditions) in a collection and return the value of a single field.
For example: There is a field called "marks" in each document and I want to return the value in "marks". So if the "marks" field has the value of 5 in each of the 3 documents I want to obtain [5,5,5] (i.e 5 three times). So the distinct method doesn't work and so far that's the only method I've been finding on the internet so far.
Any help will be much appreciated.
Thanks