我有一个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"})
我得到以下结果
我究竟做错了什么?
你需要搜索db.labels.find({ "labels.name": "Planet E" })
.该name
物业属于labels
关键.