【问题标题】:Searching in json document using robomongo使用 robomongo 在 json 文档中搜索
【发布时间】:2015-04-21 03:12:56
【问题描述】:

我有一个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"})

我得到以下结果

我做错了什么?

【问题讨论】:

    标签: mongodb robo3t


    【解决方案1】:

    您需要搜索db.labels.find({ "labels.name": "Planet E" })name 属性位于 labels 键下。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-22
      • 2014-06-25
      • 1970-01-01
      • 1970-01-01
      • 2015-06-01
      • 1970-01-01
      相关资源
      最近更新 更多