I have an Object Type A, which has a many to many relation to Object Type B. I am trying to implement an OntologyEditFunction in TypeScript that retrieves all objects of type B that are linked to an object of type A, and then edits the returned objects. My code so far looks something like the following:
@OntologyEditFunction()
public async editLinkedObjects(objA: ObjectTypeA): Promise<void> {
// Get all objects of type B that are linked to objA
const linkedObjects = objA.objectTypeB.all();
// Edit linked objects...
}
I noticed that the .all()
function returns a readonly array (i.e. the return type of linkedObjects
is a readonly ObjectTypeB[]
). Given this, how can I modify linkedObjects
such that I can apply edits to it?