Mongo, populate nested field only from collection

System Information
  • Strapi Version: 3.4.0
  • Operating System: MacOS
  • Database: MongoDB
  • Node Version: v14.15.3

Hi there,
how i can populate only nested field from collection?


"attributes": {
  "admin": {
    "plugin": "users-permissions",
    "model": "user",
    "via": "restaurant"
  "users": {
    "plugin": "users-permissions",
    "collection": "user",
    "via": "restaurant"

Original query

populate = [];
// model, working as well, returned only user id in admin field
populate = [''];
// collection, working as well, returned all populated users with nested fields
populate = ['users'];
// collection, but how i can get only from collection?
populate = [''];

strapi.query('restaurant').findOne({ id: }, populate);

Expected result

  admin: ID,
  users: [ID, ID, ID], // not user model

You can use autoPopulate for this. Set it to false for the users model. Then in populate define only

populate = [‘’];

1 Like