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
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
The text was updated successfully, but these errors were encountered:
mitsos1os
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
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 :)
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:
Also issuing a
GET /api/Customers/7/emails/count
results with "count":0, while at the same timeGET /api/Customers/7/emails/
returns a list of 2 emailsThe text was updated successfully, but these errors were encountered: