Options
All
  • Public
  • Public/Protected
  • All
Menu

A pattern to update the properties of matching subjects in the domain.

Examples:


Delete a subject property

{
  "@delete": {
    "@id": "fred",
    "name": "Fred"
  }
}

Delete a property, where another property has a value

{
  "@delete": {
    "@id": "?id",
    "age": "?any"
  },
  "@where": {
    "@id": "?id",
    "name": "Fred",
    "age": "?any"
  }
}

Update a subject property

{
  "@delete": {
    "@id": "fred",
    "name": "Fred"
  },
  "@insert": {
    "@id": "fred",
    "name": "Fred Flintstone"
  }
}

Replace all of a subject's properties

{
  "@delete": {
    "@id": "fred",
    "?prop": "?value"
  },
  "@insert": {
    "@id": "fred",
    "age": 50,
    "name": "Fred Flintstone"
  }
}
see

json-rql update

Hierarchy

Index

Properties

Optional @context

@context: Context

A JSON-LD Context for the query. In an API, this will frequently be implicit. For example, using json-rql as the body of a POST to http://example.com/my-api/v1/person/query might have the implicit context of a Person (possibly found at http://example.com/my-api/v1/person).

see

examples

Optional @delete

@delete: Subject | Subject[]

Subjects with properties to be deleted from the domain. Variables can be used without a @where clause, to match any value.

Optional @insert

@insert: Subject | Subject[]

Subjects with properties to be inserted into the domain. If variables are used, then a @where clause must be supplied to provide matching values.

Optional @where

@where: Subject | Subject[] | Group

The data pattern to match, as a set of subjects or a group. Variables are used as placeholders to capture matching properties and values in the domain.

Examples:


Match a subject by its @id

{
  ...
  "@where": { "@id": "fred" }
}

Match a subject where any property has a given value

{
  ...
  "@where": {
    "@id": "?id",
    "?prop": "Bedrock"
  }
}

Match a subject with a given property, having any value

{
  ...
  "@where": {
    "@id": "?id",
    "name": "?name"
  }
}

The Javascript engine supports exact-matches for subject identities, properties and values. Inline filters will be available in future.

Legend

  • Property
  • Method
  • Constructor

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.7.0 Source code licensed MIT. Privacy policy