when declared relation like this
{
name : "Parent"
relations: {
"type": "embedsMany",
"model": "Child"
}
}
then call
GET /parents/{pk}/children/count
It count on Child collection instead of sub-document
+1
It appears we have now encocuntered the same issue with ReferencesMany
I think it's related to this line in /loopback-datasource-juggler/lib/scope.js:
var targetModel = definition.targetModel(this._receiver);
@fabien would you now have a resolution for this issue?
We encounter the same issue on loopback 2.22, any progress on a possible fix ?
I have the same problem, I try and write something right ring but I can not function that I write in the script of the model.
Adding P1 as many community members are reporting in multiple areas - embedsMany, ReferencesMany.
@fabien , saw you assigned it to yourself. Are you planning to submit a PR?
@dhmlau it's been since 2014 - still working with Loopback, but unable to set aside time for a PR right now.
There have been recent changes to how count is returned in some connectors; if you can provide an example repository in GitHub to demonstrate the issue, we can revisit it but at this time this is not a priority for us.