These are chat archives for Automattic/mongoose

May 2017
Julio Borja Barra
May 28 2017 10:31

hey, I'm trying to populate some fields with no success. This are my schemas:

const PostSchema = new Schema({
    title: String,
    editedBy: String,
    postedDate: Date,
    content: String,
    mainImage: { type: Number, default: 0 },
    images: [
            type: Schema.Types.ObjectId,
            ref: 'Image'

export default mongoose.model('Post', PostSchema)
const ImageSchema = new Schema({
    name: String,
    image: String

export default mongoose.model('Image', ImageSchema)

And the attempt to populate:

        .exec((err, post) => {
            if (err) {


I just get the array of IDs...

Julio Borja Barra
May 28 2017 11:04
ok, found it. I was putting an extra _ in populate...
Julio Borja Barra
May 28 2017 11:40
why does mongoose complain about 'async operation without callback is deprecated' if I'm trying to use promises?