You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
embedsMany relationship publishes count on swagger, but it does not exist or work #956
When implementing an embedsMany relationship, the endpoints automatically created, expose a count method. Also in code, the relationName has a count property - method.
The problem is that neither of them works. This can also be verified in the official loopback-example-relations
ex:
// Customer with emails is probably id 7
Customer.findById(7)
.then(customer => {
return customer.emails.count()
})
.then(count => {
console.log(count); // It should be 2 as created in example, but it shows 0
})
Also issuing a GET /api/Customers/7/emails/count results with "count":0, while at the same time GET /api/Customers/7/emails/ returns a list of 2 emails
changed the title [-]embedsMany relationship publishes **count** on swagger, but it does not exist or work[/-][+]embedsMany relationship publishes count on swagger, but it does not exist or work[/+]on Jun 1, 2016
A duplidate bug as #258
To keep it easy to track, let's keep the update of fix and further discussion under that one.
I am closing this issue. Thanks for understanding :)
Activity
[-]embedsMany relationship publishes **count** on swagger, but it does not exist or work[/-][+]embedsMany relationship publishes count on swagger, but it does not exist or work[/+]jannyHou commentedon Aug 12, 2016
A duplidate bug as #258
To keep it easy to track, let's keep the update of fix and further discussion under that one.
I am closing this issue. Thanks for understanding :)