1

我有一个json文件如下:

{
"_id" : ObjectId("553547d3864c23ae8837f8f2"),
"labels" : {
    "id" : "1",
    "name" : "Planet E",
    "sublabels" : "Antidote (4)Community ProjectsGuilty PleasuresI Ner Zon SoundsPlanet E Communications, Inc.TWPENTY",
    "contactinfo" : "Planet E Communications\nP.O. Box 27218\nDetroit, 48227, USA\n\np: 313.874.8729 \nf: 313.874.8732\n\nemail: info AT Planet-e DOT net\n",
    "profile" : "Classic Techno label from Detroit, USA.\n[b]Label owner:[/b] [a=Carl Craig].\n",
    "dataquality" : "Needs Vote",
    "urls" : "http://planet-e.nethttp://planetecommunications.bandcamp.comhttp://www.discogs.com/user/planetedetroithttp://www.facebook.com/planetedetroithttp://www.flickr.com/photos/planetedetroithttp://plus.google.com/100841702106447505236http://myspace.com/planetecomhttp://myspace.com/planetedetroithttp://soundcloud.com/planetedetroithttp://twitter.com/planetedetroithttp://vimeo.com/user1265384http://www.youtube.com/user/planetedetroithttp://en.wikipedia.org/wiki/Planet_E_Communications"
}
}

当我使用以下命令时

db.labels.find({name: "Planet E"})

我得到以下结果

在此处输入图像描述

我究竟做错了什么?

4

1 回答 1

5

您需要搜索db.labels.find({ "labels.name": "Planet E" }). 该name物业在labels钥匙下。

于 2015-04-20T19:12:56.523 回答