SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
807 stars 171 forks source link

How to add custom _links #85

Closed AntonioSpalluto closed 8 years ago

AntonioSpalluto commented 8 years ago

Is there any way to add some custom _links into a document?

Cheers

ujibang commented 8 years ago

Hi Antonio,

the only way to modify the _links is defining a relationship; this will add the referenced documents between the _links

https://softinstigate.atlassian.net/wiki/x/iYCM

What is your use case?

You can also modify the getRepresentation() method of the class DocumentRepresentationFactory adding links

Representation rep;
...
rep.addLink(new Link("example", "http://example.com"));
...
AntonioSpalluto commented 8 years ago

Hi Andrea,

I need to add some "templated" links, so I cannot use the relationship in this case due I should specify an ObjectID. I would prefer to avoid customization of the source code for maintenance reasons... are you thinking to add it in some of the next releases?

Thanks for the prompt reply

ujibang commented 8 years ago

Hi Antonio,

I'm sorry but we don't have anything for this in our roadmap. If you want us to add it to restheart then you'll need to buy a custom development package.

Please refer to http://restheart.org/support-packages.html