Finding a link in the model

I have a requirement to dynamically change attributes on links (like show / hide or change their appearance) based on business attributes of these links, unrelated to “from” or “to” nodes. Each of my links has a unique key, but I cannot use it to find a link as the case with nodes. As a result, I do something like the following:

function updateLinkAtribute (key, attribute, value) {
var link = diagram.findLinksByExample({ key: key }).first();
if (link) {
diagram.model.setDataProperty(, attribute, value);
I suspect this code is not efficient and on a big diagram with large number of links to be updated performance may suffer. Is there a better way to do what I need, probably using unpublished APIs like usage of internal object ids?

Thank you

GraphLinksModel supports that in version 1.6.