对于以下数据(取自MongoDB in Action),我如何在 Mongo Shell 中查询以获取等于“home”addresses.street
的任何文档(在我的情况下,这里只有 1 个) ?addresses.home
期望的结果:{"street" : "1 E. 23rd Street"}
{ _id: ObjectId("4c4b1476238d3b4dd5000001")
username: "kbanker",
addresses: [
{
name: "home",
street: "588 5th Street",
city: "Brooklyn",
state: "NY",
zip: 11215},
{
name: "work",
street: "1 E. 23rd Street",
city: "New York",
state "NY",
zip 10010},
]}