How do I query to display a specific field of a MongoDB document?


#1

Hi everyone,

I’m having trouble figuring out how to query a JSON document for my Meteor project.

My JSON document looks like this:

http://jsoneditoronline.org/?id=d2921bf9a1648ac1035acf6aeab3232a

And what I need to do is query the data in my javascript so that I display just the ConcentrationTier1 fields from the final node of the JSON in a console.log() statement. There are thousands of these ‘ConcentrationTier1’ fields in my database and I want to display them all not just use dot notation to drill down to 1 specific ‘ConcentrationTier1’ field.

Any help on how I can do this?

Many thanks,

G