If I understand you correctly, you are trying to show the returned model in this section as follows:
[ { "companyProperty1": "companyProperty1Type", "companyProperty2": "companyProperty2Type", . . "companyPropertyN": "companyPropertyNType", } ]
To get such a representation of the return type, you need to define the return type in the remoteMethod parameters as an array of the desired model.
Here is your code with the required editing, using modelName propertyy for the base class Model :
Company.remoteMethod( 'find', { accepts: {arg: 'msg', type: 'string'}, returns: {type: [Company.modelName], root: true}, http: {path: '/', verb:'get'} } )
Reuven chacha
source share