moleculerjs / moleculer-db

:battery: Database access service mixins for Moleculer
https://moleculer.services/
MIT License
152 stars 122 forks source link

Nested populate not working #230

Open mlromero opened 4 years ago

mlromero commented 4 years ago

Hello,

I am following this example: https://github.com/moleculerjs/moleculer-examples/blob/master/conduit/services/articles.service.js and I have applied nested populate but not working. Main populate is working perfect.

Requests services:

fields: ["_id", "comment", "pet", "createdAt", "updatedAt" ],

populates: { "pet": { action: "pets.get", params: { fields: ["_id", "name", "especie", "raza", "age", "color" ] } },}

Attention service: fields: ["_id", "request", "vet", "client", "createdAt", "updatedAt" ],

populates: { "request": { action: "requests.get", params: { fields: [ "_id", "comment", "pet" ], populates: [ "pet" ] } }, "client": { action: "clients.get", params: { fields: ["_id", "name", "lastname", "email", "address" ] } }, "vet": { action: "vets.get", params: { fields: ["_id", "name", "lastname", "email", "actual_address" , "education"] } } },

let params = { limit, offset, sort: ["-createdAt"], populate: [ "request", "client" ], query: query };

Any idea?

Thanks for yours responses.

Regards.

cristianm commented 1 year ago

Same here.