我是MongoDB的新手,我正在尝试查询以下集合(名为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": ""
}]
}
我正在尝试检索“ GRADE”为“ CC004”的整个记录。
现在,我正在执行以下操作:db.sample.find({"thresholds": {"GRADE": "CC004"}})
。但是,它返回空值,因为未找到任何内容。如何重新查询以查找感兴趣的条目?
Podrias hacer la siguiente consulta:
db.sample.find({"thresholds.GRADE": "CC004"})