Skip to content

Instantly share code, notes, and snippets.

@gtwalford
Created September 12, 2016 21:17
Show Gist options
  • Save gtwalford/3180364bea27161558d89114cea0efcc to your computer and use it in GitHub Desktop.
Save gtwalford/3180364bea27161558d89114cea0efcc to your computer and use it in GitHub Desktop.
Example of deep populate for mongo with mongoose
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