moleculerjs / database

Advanced Database Access Service for Moleculer microservices framework
MIT License
32 stars 15 forks source link

Populate nested fields #20

Closed maxinminax closed 1 year ago

maxinminax commented 2 years ago

As title, have any way to config populate fields in object item of sub array? Example

settings: {
  fields: {
    arrayField: {
      type: 'array',
      items: {
        type: 'object',
        props: {
          normalField: { type: 'string' },
          needPopulatedField: { type: 'object', virtual: true, populate() {} }
        }
      }
    }
  }
}
icebob commented 2 years ago

I didn't test it, but maybe it can work.