猫鼬选择两级人口

时间:2016-07-20 22:10:13

标签: mongodb mongoose database

我有这样的查询

$, Claw         "OnCreativity" (2012)  [Himself]

$, Homo         Nykytaiteen museo (1986)  [Himself]  <25>
                   Suuri illusioni (1985)  [Guests]  <22>

$hutter         Battle of the Sexes (2017)  (as $hutter Boy)  [Bobby Riggs Fan]  <10>
                   NVTION: The Star Nation Rapumentary (2016)  (as $hutter Boy)  [Himself]  <1>
                   Secret in Their Eyes (2015)  (uncredited)  [2002 Dodger Fan]
                   Steve Jobs (2015)  (uncredited)  [1988 Opera House Patron]
                   Straight Outta Compton (2015)  (uncredited)  [Club Patron/Dopeman]

$lim, Bee Moe       Fatherhood 101 (2013)  (as Brandon Moore)  [Himself - President, Passages]
                   For Thy Love 2 (2009)  [Thug 1]
                   Night of the Jackals (2009) (V)  [Trooth]
                   "Idle Talk" (2013)  (as Brandon Moore)  [Himself]
                   "Idle Times" (2012) {(#1.1)}  (as Brandon Moore)  

$ly, Yung           Town Bizzness Pt 3 (2014) (V)  [Yung $ly]
                   "From Tha Bottom 2 Tha Top" (2016)  [Yung $ly]
                   "From Tha Bottom 2 Tha Top" (2016) {T-Pain (#1.2)}  [Yung $ly]

$torm, Cuntry       From the Woods: The Discovery of LYB (????)  (as Country $torm)  [Himself]

& Davi, Bruninho   Michel na Balada (2011) (V)  [Themselves]
                   Michel TelÛ: Sunset (2013) (V)  [Themselves]
                   "Programa da Sabrina" (2014) {(2016-01-23)}  [Themselves]

& Dollar Furado, Caio Corsalette    "Som Brasil" (2007) {ZezÈ di Camargo & Luciano (#5.7)}  [Themselves]

& Fabiano, CÈsar Menotti    Nascemos para Cantar (2010) (TV)  [Themselves]
                            Show da Virada (2011) (TV)  [Themselves - Performers]
                            Teleton 2010 (2010) (TV)  [Themselves]
                            "Altas Horas" (2000) {(2013-06-29)}  [Themselves]
                            "Altas Horas" (2000) {(2013-12-14)}  [Themselves]
                            "Eliana" (2009) {(2012-10-21)}  [Themselves]
                            "Tudo … PossÌvel" (2005) {(2008-04-13)}  [Themselves]
                            "TV Xuxa" (2005) {(2013-01-05)}  [Themselves]

在这个查询中,如果我删除选择 - 一切正常,但是当我想要选择我想要的字段(不是全部)时,(选择作为第一级别人口的选项)填充不起作用,你能帮帮我吗? / p>

1 个答案:

答案 0 :(得分:1)

这可能是因为您的嵌套populate.populate({})的选项,因此可能没有select选项。请参阅this文档的跨多个级别填充部分。

您也可以尝试递归填充。有关详细信息,请参阅this答案。