I'm new to MongoDB and I'm trying to query the following collection (named sample):
{
"_id": "thresholds",
"thresholds": [{
"GRADE": "CC004",
"C": "",
"CF": "",
"MN": "0.01",
"N": "",
"P": "0.03",
"SI": "",
"CR": ""
}, {
"GRADE": "CC005",
"C": "",
"CF": "",
"MN": "",
"N": "",
"P": "",
"SI": "",
"CR": ""
}]
}
I'm trying to retrieve the entire record where the "GRADE" is "CC004".
Right now, I'm doing the following: db.sample.find({"thresholds": {"GRADE": "CC004"}})
. However, it's returning null value because nothing was found. How can I rephrase my query to find my entry of interest?