Closed suryabigapp closed 4 years ago
Remove the type
key, because as written, your schema defines status
as a Mixed
path, and autopopulate doesn't look underneath mixed paths.
status: {
//type: {
id: {
type: ObjectId,
ref: 'CustomerStatus',
autopopulate: { select: 'title' },
},
updatedBy: {
type: ObjectId,
ref: 'User',
autopopulate: { select: 'name' },
},
updatedAt: {
type: Date,
},
},
},
See Automattic/mongoose#7181
Something like this