mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 02:16:03 +00:00
Limit populate object where model is equal
This commit is contained in:
parent
46ff89e404
commit
134fa960cd
@ -106,7 +106,8 @@ module.exports = function (strapi) {
|
||||
if (this._mongooseOptions.populate && this._mongooseOptions.populate[association.alias]) {
|
||||
if (association.nature === 'oneToMorph' || association.nature === 'manyToMorph') {
|
||||
this._mongooseOptions.populate[association.alias].match = {
|
||||
[`${association.via}.${association.where}`]: association.alias
|
||||
[`${association.via}.${association.where}`]: association.alias,
|
||||
[`${association.via}.kind`]: definition.globalId
|
||||
}
|
||||
} else {
|
||||
this._mongooseOptions.populate[association.alias].path = `${association.alias}.${association.key}`;
|
||||
|
||||
@ -36,10 +36,6 @@
|
||||
"via": "users",
|
||||
"plugin": "users-permissions",
|
||||
"configurable": false
|
||||
},
|
||||
"avatar": {
|
||||
"model": "upload",
|
||||
"via": "related"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user