adamspe / odata-resource

Node.JS+Express+REST
https://www.npmjs.com/package/odata-resource
12 stars 4 forks source link

$expand #5

Closed ahbtoplama closed 6 years ago

ahbtoplama commented 6 years ago

Hi

Any of the friends may need master-detail tables on the real time. Can you and $expand feature on odata-resource ?

adamspe commented 6 years ago

I'll look into adding it. In the meantime, you can use the "populate" property when defining your resource (https://adamspe.github.io/odata-resource/Resource.html). Though then it will always be there, not only on request.

Doing this requires that your mongoose schema is set up properly. That is there is a mongoose schema for the included related reference and the "ref" is properly defined on the reference schema itself.

adamspe commented 6 years ago

Published version 1.2 with support for $expand.

https://www.npmjs.com/package/odata-resource#new-in-12