Created
September 12, 2016 21:17
-
-
Save gtwalford/3180364bea27161558d89114cea0efcc to your computer and use it in GitHub Desktop.
Example of deep populate for mongo with mongoose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var q = keystone.list('IconographyPage') | |
.model | |
.find() | |
.lean() | |
.populate({ | |
path: 'iconSections', | |
populate: { path: 'icons' } | |
}); | |
q.exec(function (err, results) { | |
locals.data = results[0]; | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment