These are chat archives for Automattic/mongoose

Mar 2016
Bnaya Peretz
Mar 31 2016 08:18
const variantSchema = new Schema({
    differentiator: Schema.Types.Mixed,
    storageEntry: { type: Schema.Types.ObjectId, ref: 'Storage' }

const schema = new Schema({
    type: String,
    variants: [variantSchema],
}, {
    timestamps: true
I want to populate the variants[].storageEntry, is it possible to do so?
Or it has to be flat array of ids
Bnaya Peretz
Mar 31 2016 10:19
that was more simple then i expected :) doc.populate<IAsset>('variants.storageEntry'
Mar 31 2016 13:13
I want to skip and limit in order for pagination to work but this does not work and gives me all results instead
                .populate('user', 'name username')
                .populate('tags', 'title color')
                .populate('categories', 'title')
                .exec(function(err, projects) {