我在这里有一个 mongodb 数据库中的两个文档的集合(我正在使用 robomongo)
我从 如何将多个文档合并到一个文档中并移动到另一个集合中获取了解决方案?
但是我最终是空的
原始文件的代码如下:
{
"_id" : ObjectId("5534e79726092822df7528ff"),
"labels" : {
"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",
"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"
}
}
{
"_id" : ObjectId("5534e79726092822df752900"),
"labels" : {
"id" : "2",
"name" : "Earthtones Recordings",
"sublabels" : [],
"contactinfo" : "Seasons Recordings\n2236 Pacific Avenue\nSuite D\nCosta Mesa, CA 92627\n\ntel: +1.949.574.5255\nfax: +1.949.574.0255\n\nemail: <a href=\"mailto:jthinnes@seasonsrecordings.com\">jthinnes@seasonsrecordings.com</a>\n",
"profile" : "California deep house label founded by Jamie Thinnes. Now defunct and continued as [l=Seasons Recordings].",
"dataquality" : "Correct",
"urls" : "http://www.seasonsrecordings.com/"
}
}
我想将两个文档合并为一个标题“标签”下的文档