loopback
loopback copied to clipboard
How can i get only some fields of related models ?
Think about models Book and Category, Book can belongsTo many Category and Category can have many Books I'm using this relation in Book model as below:
Book can have some properties like "title", "description", "created",...
Category can have some properties like "name", "id", ...
"categories": {
"type": "referencesMany",
"model": "Category"
},
Question is how can i get list of Books with some fields: {"field": {"title": true, "description": true, "categories.name": true}, "include":["categories"]}
This is not work for me. Please tell me syntax for filter that included property of related model.
Duplicate of https://github.com/strongloop/loopback-datasource-juggler/pull/324