LDkit

method Lens.prototype.update
import { Lens } from "https://deno.land/x/ldkit/mod.ts";

Updates one or more entities in the data store.

Examples

Example 1

import { createLens } from "ldkit";
import { schema } from "ldkit/namespaces";

// Create a schema
const PersonSchema = {
  "@type": schema.Person,
  name: schema.name,
} as const;

// Create a resource using the data schema above
const Persons = createLens(PersonSchema);

// Update Alan Turing's name
await Persons.update({
  $id: "http://example.org/Alan_Turing",
  name: "Not Alan Turing",
});

Parameters

...entities: SchemaUpdateInterface<T>[]

Partial entities to update

Returns

Promise<void>

Nothing