How can I check if any link exist between 2 objects?

In a Function On Object (FoO) I would like to check if any link exist, but without pulling the objects in memory.

Pseudo code I want to avoid:

const linkedObjects = someObject.linkType.all();
if (linkedObjects.length === 0) { ... }

Is it possible ?

You can use the “.isPresent()” syntax

From : https://www.palantir.com/docs/foundry/functions/api-object-sets/