MCPcopy Create free account
hub / github.com/codemix/graph / updateProperty

Method updateProperty

packages/y-graph-storage/src/YGraphStorage.ts:403–414  ·  view source on GitHub ↗
(id: ElementId, key: string, value: any)

Source from the content-addressed store, hash-verified

401 }
402
403 public updateProperty(id: ElementId, key: string, value: any): void {
404 const [label, uuid] = parseElementId(id);
405 const isVertex = label in this.#config.schema.vertices;
406 const collection = isVertex
407 ? this.getVertexCollectionMap(label)
408 : this.getEdgeCollectionMap(label);
409 const data = collection.get(uuid);
410 if (data == null) {
411 throw new ElementNotFoundError(id);
412 }
413 data.set(key, value);
414 }
415
416 protected transact(callback: (tx: Y.Transaction) => void): void {
417 this.#doc.transact(callback);

Callers

nothing calls this directly

Calls 4

getEdgeCollectionMapMethod · 0.95
parseElementIdFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected