mongoose-power-populate
"Join" mongoose documents. Recursively populate document references in either direction.
DEPRECATED: Use Mongoose 4+ and mongoose-populate-virtuals instead.
Usage
Wrap mongoose to provide an improved populate()
method:
var mongoose = ;var populatePlugin = mongoose;
Populate paths with predefined options:
Book;
Specify options for population paths on the model:
BookSchema;
Populate nested paths:
User ;
Override options at query time:
Book ;
Populate existing documents:
Book;
Options
ref
Name of the mongoose model.foreignKey
Key on the model of the populated subdocuments.localKey
Key on the model being populated.singular
Whether to return a single result or an array of results.lean
Whether to populate with models or plain objects.query
Specify thefind()
query used to fetch related documented.select
Passed to mongoose's.select()
.