Mutations

A mutation is a query and a patch together. The query selects the entities, and the patch gives the new state of each one. Stardust commits every change in one transaction. Each example reads the same five entities as Queries.

The document

A mutation document has query and patch. The query is an ordinary query, and the patch follows the form in Patches.

TRON222 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
042C 3F65txt "?e"
070E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
142C 3F65txt "?e"
174C 64657074txt "dept"
1C3C 6F7073txt "ops"
200E 15 00 0700 030000 00 14000000 170000 00 1C000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C
350E 0D 00 0100 010000 00 20000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20
425C 7768657265txt "where"
480F 0A 42000000 3500 0000map leaf, size 10: @42 → @35
524C 66696E64txt "find"
570F 0A 52000000 0700 0000map leaf, size 10: @52 → @7
6107 0E 0A000000 4800 0000 57000000map branch, size 14, depth 0 (root), slots 1, 3: @48 → @57
6F6C 737461747573txt "status"
766C 616374697665txt "active"
7D0F 0A 6F000000 7600 0000map leaf, size 10: @6F → @76
872C 3F65txt "?e"
8A0F 0A 87000000 7D00 0000map leaf, size 10: @87 → @7D
945C 7175657279txt "query"
9A0F 0A 94000000 6100 0000map leaf, size 10: @94 → @61
A45C 7061746368txt "patch"
AA0F 0A A4000000 8A00 0000map leaf, size 10: @A4 → @8A
B407 0E 40020000 9A00 0000 AA000000map branch, size 14, depth 2, slots 6, 9: @9A → @AA
C207 0A 01000000 B400 0000map branch, size 10, depth 1, slots 0: @B4
CC07 0A 80000000 C200 0000map branch, size 10, depth 0 (root), slots 7: @C2

Each key of the patch is a target. A key that begins with ? uses an entity variable bound by the query. A temporary name such as #_new makes a new entity, as in a patch.

Preview and commit

The native mutation run commits the selection and resolved patch together. The core also has a preview path that validates the same selection, resolution and store rules without writing facts. The public ABI does not currently expose that preview.

The result blocks on this page show the core report's status and counts. The public mutation result uses lowercase status names and also gives the commit time and generated entity ids.

TRON146 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 436F6D6D697474 6564txt "Committed"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1FBC 7472616E736163 74696F6Etxt "transaction"
2B02 07000000000000 00i64 7
340F 0A 1F000000 2B00 0000map leaf, size 10: @1F → @2B
3E9C 67656E65726174 6564txt "generated"
4802 00000000000000 00i64 0
510F 0A 3E000000 4800 0000map leaf, size 10: @3E → @48
5B5C 6661637473txt "facts"
6102 01000000000000 00i64 1
6A0F 0A 5B000000 6100 0000map leaf, size 10: @5B → @61
7407 16 01620000 1500 0000 34000000 5100 0000 6A000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A

The three statuses

StatusMeaning
CommittedThe patch writes facts in a new transaction
No_ChangeThe selection matches and every field already agrees
No_MatchThe selection matches no entity

A second run of the same mutation changes nothing, so Stardust commits no new transaction.

TRON146 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 4E6F5F4368616E 6765txt "No_Change"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1FBC 7472616E736163 74696F6Etxt "transaction"
2B02 00000000000000 00i64 0
340F 0A 1F000000 2B00 0000map leaf, size 10: @1F → @2B
3E9C 67656E65726174 6564txt "generated"
4802 00000000000000 00i64 0
510F 0A 3E000000 4800 0000map leaf, size 10: @3E → @48
5B5C 6661637473txt "facts"
6102 00000000000000 00i64 0
6A0F 0A 5B000000 6100 0000map leaf, size 10: @5B → @61
7407 16 01620000 1500 0000 34000000 5100 0000 6A000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A

A selection that matches no entity gives the same counts. No entity is in the department legal:

TRON224 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
042C 3F65txt "?e"
070E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
142C 3F65txt "?e"
174C 64657074txt "dept"
1C5C 6C6567616Ctxt "legal"
220E 15 00 0700 030000 00 14000000 170000 00 1C000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C
370E 0D 00 0100 010000 00 22000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @22
445C 7768657265txt "where"
4A0F 0A 44000000 3700 0000map leaf, size 10: @44 → @37
544C 66696E64txt "find"
590F 0A 54000000 0700 0000map leaf, size 10: @54 → @7
6307 0E 0A000000 4A00 0000 59000000map branch, size 14, depth 0 (root), slots 1, 3: @4A → @59
716C 737461747573txt "status"
786C 616374697665txt "active"
7F0F 0A 71000000 7800 0000map leaf, size 10: @71 → @78
892C 3F65txt "?e"
8C0F 0A 89000000 7F00 0000map leaf, size 10: @89 → @7F
965C 7175657279txt "query"
9C0F 0A 96000000 6300 0000map leaf, size 10: @96 → @63
A65C 7061746368txt "patch"
AC0F 0A A6000000 8C00 0000map leaf, size 10: @A6 → @8C
B607 0E 40020000 9C00 0000 AC000000map branch, size 14, depth 2, slots 6, 9: @9C → @AC
C407 0A 01000000 B600 0000map branch, size 10, depth 1, slots 0: @B6
CE07 0A 80000000 C400 0000map branch, size 10, depth 0 (root), slots 7: @C4
TRON145 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B8C 4E6F5F4D617463 68txt "No_Match"
140F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1EBC 7472616E736163 74696F6Etxt "transaction"
2A02 00000000000000 00i64 0
330F 0A 1E000000 2A00 0000map leaf, size 10: @1E → @2A
3D9C 67656E65726174 6564txt "generated"
4702 00000000000000 00i64 0
500F 0A 3D000000 4700 0000map leaf, size 10: @3D → @47
5A5C 6661637473txt "facts"
6002 00000000000000 00i64 0
690F 0A 5A000000 6000 0000map leaf, size 10: @5A → @60
7307 16 01620000 1400 0000 33000000 5000 0000 69000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @14 → @33 → @50 → @69

New entities

A temporary name such as #_new makes an entity. The selection must give exactly one row, because one new entity needs one parent row. A {#link #_new} value in the same patch links to that entity. {#link #_tx} links to the committing transaction.

TRON252 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
042C 3F65txt "?e"
070E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
142C 3F65txt "?e"
174C 64657074txt "dept"
1C3C 6F7073txt "ops"
200E 15 00 0700 030000 00 14000000 170000 00 1C000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C
350E 0D 00 0100 010000 00 20000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20
425C 7768657265txt "where"
480F 0A 42000000 3500 0000map leaf, size 10: @42 → @35
524C 66696E64txt "find"
570F 0A 52000000 0700 0000map leaf, size 10: @52 → @7
615C 6C696D6974txt "limit"
6702 01000000000000 00i64 1
700F 0A 61000000 6700 0000map leaf, size 10: @61 → @67
7A07 12 2A000000 4800 0000 57000000 7000 0000map branch, size 18, depth 0 (root), slots 1, 3, 5: @48 → @57 → @70
8C6C 737461747573txt "status"
934C 73656564txt "seed"
980F 0A 8C000000 9300 0000map leaf, size 10: @8C → @93
A25C 235F6E6577txt "#_new"
A80F 0A A2000000 9800 0000map leaf, size 10: @A2 → @98
B25C 7175657279txt "query"
B80F 0A B2000000 7A00 0000map leaf, size 10: @B2 → @7A
C25C 7061746368txt "patch"
C80F 0A C2000000 A800 0000map leaf, size 10: @C2 → @A8
D207 0E 40020000 B800 0000 C8000000map branch, size 14, depth 2, slots 6, 9: @B8 → @C8
E007 0A 01000000 D200 0000map branch, size 10, depth 1, slots 0: @D2
EA07 0A 80000000 E000 0000map branch, size 10, depth 0 (root), slots 7: @E0
TRON146 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 436F6D6D697474 6564txt "Committed"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1FBC 7472616E736163 74696F6Etxt "transaction"
2B02 09000000000000 00i64 9
340F 0A 1F000000 2B00 0000map leaf, size 10: @1F → @2B
3E9C 67656E65726174 6564txt "generated"
4802 01000000000000 00i64 1
510F 0A 3E000000 4800 0000map leaf, size 10: @3E → @48
5B5C 6661637473txt "facts"
6102 01000000000000 00i64 1
6A0F 0A 5B000000 6100 0000map leaf, size 10: @5B → @61
7407 16 01620000 1500 0000 34000000 5100 0000 6A000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A

The engine rejects the same patch against a selection of two rows. Two entities are in the department eng:

TRON223 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
042C 3F65txt "?e"
070E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
142C 3F65txt "?e"
174C 64657074txt "dept"
1C3C 656E67txt "eng"
200E 15 00 0700 030000 00 14000000 170000 00 1C000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C
350E 0D 00 0100 010000 00 20000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20
425C 7768657265txt "where"
480F 0A 42000000 3500 0000map leaf, size 10: @42 → @35
524C 66696E64txt "find"
570F 0A 52000000 0700 0000map leaf, size 10: @52 → @7
6107 0E 0A000000 4800 0000 57000000map branch, size 14, depth 0 (root), slots 1, 3: @48 → @57
6F6C 737461747573txt "status"
764C 73656564txt "seed"
7B0F 0A 6F000000 7600 0000map leaf, size 10: @6F → @76
855C 235F6E6577txt "#_new"
8B0F 0A 85000000 7B00 0000map leaf, size 10: @85 → @7B
955C 7175657279txt "query"
9B0F 0A 95000000 6100 0000map leaf, size 10: @95 → @61
A55C 7061746368txt "patch"
AB0F 0A A5000000 8B00 0000map leaf, size 10: @A5 → @8B
B507 0E 40020000 9B00 0000 AB000000map branch, size 14, depth 2, slots 6, 9: @9B → @AB
C307 0A 01000000 B500 0000map branch, size 10, depth 1, slots 0: @B5
CD07 0A 80000000 C300 0000map branch, size 10, depth 0 (root), slots 7: @C3

Error

Generate_Requires_Single

Patch values and variables

The body for each target is a merge patch. It accepts every Stardust value: numbers, text, booleans, lists, maps, links and the other typed values. A null removes the field.

TRON64 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
043C 616765txt "age"
0802 05000000000000 00i64 5
110F 0A 04000000 0800 0000map leaf, size 10: @4 → @8
1B2C 3F65txt "?e"
1E0F 0A 1B000000 1100 0000map leaf, size 10: @1B → @11
285C 7061746368txt "patch"
2E0F 0A 28000000 1E00 0000map leaf, size 10: @28 → @1E

This sets age to 5 on every entity bound to ?e.

The query may bind a patch variable in where or expose it through find. Both forms refer to the same row binding. A variable used as a patch target must bind an entity. A variable used as a field value substitutes its complete bound value.

TRON354 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0047C 3F737461747573txt "?status"
00C0E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
0192C 3F65txt "?e"
01C6C 737461747573txt "status"
0237C 3F737461747573txt "?status"
02B0E 15 00 0700 030000 00 19000000 1C0000 00 23000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @19 → @1C → @23
0401C 3Dtxt "="
0427C 3F737461747573txt "?status"
04A7C 70656E64696E67txt "pending"
0520E 15 00 0700 030000 00 40000000 420000 00 4A000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @40 → @42 → @4A
0676C 3F6F776E6572txt "?owner"
06E4C 6E616D65txt "name"
0733C 416461txt "Ada"
0770E 15 00 0700 030000 00 67000000 6E0000 00 73000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @67 → @6E → @73
08C0E 15 00 0700 030000 00 2B000000 520000 00 77000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @2B → @52 → @77
0A15C 7768657265txt "where"
0A70F 0A A1000000 8C00 0000map leaf, size 10: @A1 → @8C
0B14C 66696E64txt "find"
0B60F 0A B1000000 0C00 0000map leaf, size 10: @B1 → @C
0C007 0E 0A000000 A700 0000 B6000000map branch, size 14, depth 0 (root), slots 1, 3: @A7 → @B6
0CE6C 737461747573txt "status"
0D56C 616374697665txt "active"
0DC0F 0A CE000000 D500 0000map leaf, size 10: @CE → @D5
0E65C 6F776E6572txt "owner"
0EC6C 3F6F776E6572txt "?owner"
0F30F 0A E6000000 EC00 0000map leaf, size 10: @E6 → @EC
0FD07 0E 03000000 DC00 0000 F3000000map branch, size 14, depth 0 (root), slots 0, 1: @DC → @F3
10B2C 3F65txt "?e"
10E0F 0A 0B010000 FD00 0000map leaf, size 10: @10B → @FD
1185C 7175657279txt "query"
11E0F 0A 18010000 C000 0000map leaf, size 10: @118 → @C0
1285C 7061746368txt "patch"
12E0F 0A 28010000 0E01 0000map leaf, size 10: @128 → @10E
13807 0E 40020000 1E01 0000 2E010000map branch, size 14, depth 2, slots 6, 9: @11E → @12E
14607 0A 01000000 3801 0000map branch, size 10, depth 1, slots 0: @138
15007 0A 80000000 4601 0000map branch, size 10, depth 0 (root), slots 7: @146

Stardust rejects a mutation with a malformed patch or an unbound variable. It also rejects a target that does not bind an entity or writes a protected stardust/* field. An invalid typed value or a result that violates the selected schema also causes rejection.

When a grouped mutation selects several schemas for an entity, the complete patched document must satisfy all of them. Schema paths do not need to be group keys. Groups removed by having, paging or other selection stages contribute no schema constraints.

A mutation cannot write a definition. Stardust rejects a definition target with Definition_Target. Definitions include schemas, queries and mutations. A patch that writes stardust/type also gives Definition_Target. The preview gives the same error, and no fact changes. Use the definition API to change a definition.

Computed values

Each field value is an expression evaluated for each selected row. A ?name reads the row binding, plain text stays text, and maps are evaluated member by member. #_tx metadata is evaluated once per run and may read caller inputs, declared or implicit parameters, but no other row bindings. A list whose first element names a function or macro is a call. Other lists evaluate each element. Use list when the first element names a function or macro but should stay data:

TRON569 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0042C 3F65txt "?e"
0074C 3F616765txt "?age"
00C0E 11 00 0300 020000 00 04000000 070000 00array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @7
01D2C 3F65txt "?e"
0204C 6E616D65txt "name"
0252C 4379txt "Cy"
0280E 15 00 0700 030000 00 1D000000 200000 00 25000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @1D → @20 → @25
03D2C 3F65txt "?e"
0403C 616765txt "age"
0444C 3F616765txt "?age"
0490E 15 00 0700 030000 00 3D000000 400000 00 44000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @3D → @40 → @44
05E0E 11 00 0300 020000 00 28000000 490000 00array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @28 → @49
06F5C 7768657265txt "where"
0750F 0A 6F000000 5E00 0000map leaf, size 10: @6F → @5E
07F4C 66696E64txt "find"
0840F 0A 7F000000 0C00 0000map leaf, size 10: @7F → @C
08E07 0E 0A000000 7500 0000 84000000map branch, size 14, depth 0 (root), slots 1, 3: @75 → @84
09C1C 3Ctxt "<"
09E4C 3F616765txt "?age"
0A302 1E000000000000 00i64 30
0AC0E 15 00 0700 030000 00 9C000000 9E0000 00 A3000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @9C → @9E → @A3
0C12C 6966txt "if"
0C46C 6A756E696F72txt "junior"
0CB6C 73656E696F72txt "senior"
0D20E 19 00 0F00 040000 00 C1000000 AC0000 00 C4000000 CB0000 00array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @C1 → @AC → @C4 → @CB
0EB6C 64657369676Etxt "design"
0F26C 72656D6F7465txt "remote"
0F90E 11 00 0300 020000 00 EB000000 F20000 00array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @EB → @F2
10A02 01000000000000 00i64 1
11302 02000000000000 00i64 2
11C02 03000000000000 00i64 3
Show all 60 nodes
Offset (hex)Bytes (hex)Meaning
1250E 15 00 0700 030000 00 0A010000 130100 00 1C010000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @10A → @113 → @11C
13A1C 2Btxt "+"
13C4C 3F616765txt "?age"
14102 01000000000000 00i64 1
14A0E 15 00 0700 030000 00 3A010000 3C0100 00 41010000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @13A → @13C → @141
15F2C 6279txt "by"
1623C 416461txt "Ada"
1660F 0A 5F010000 6201 0000map leaf, size 10: @15F → @162
1703C 647565txt "due"
1740F 0A 70010000 4A01 0000map leaf, size 10: @170 → @14A
17E07 0E 09000000 6601 0000 74010000map branch, size 14, depth 0 (root), slots 0, 3: @166 → @174
18C4C 62616E64txt "band"
1910F 0A 8C010000 D200 0000map leaf, size 10: @18C → @D2
19B4C 74616773txt "tags"
1A00F 0A 9B010000 F900 0000map leaf, size 10: @19B → @F9
1AA6C 726576696577txt "review"
1B10F 0A AA010000 7E01 0000map leaf, size 10: @1AA → @17E
1BB6C 73636F726573txt "scores"
1C20F 0A BB010000 2501 0000map leaf, size 10: @1BB → @125
1CC07 16 01E00000 9101 0000 A0010000 B101 0000 C2010000map branch, size 22, depth 0 (root), slots 0, 13, 14, 15: @191 → @1A0 → @1B1 → @1C2
1E22C 3F65txt "?e"
1E50F 0A E2010000 CC01 0000map leaf, size 10: @1E2 → @1CC
1EF5C 7175657279txt "query"
1F50F 0A EF010000 8E00 0000map leaf, size 10: @1EF → @8E
1FF5C 7061746368txt "patch"
2050F 0A FF010000 E501 0000map leaf, size 10: @1FF → @1E5
20F07 0E 40020000 F501 0000 05020000map branch, size 14, depth 2, slots 6, 9: @1F5 → @205
21D07 0A 01000000 0F02 0000map branch, size 10, depth 1, slots 0: @20F
22707 0A 80000000 1D02 0000map branch, size 10, depth 0 (root), slots 7: @21D
Offset (hex)Bytes (hex)Meaning
TRON146 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 436F6D6D697474 6564txt "Committed"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1FBC 7472616E736163 74696F6Etxt "transaction"
2B02 0A000000000000 00i64 10
340F 0A 1F000000 2B00 0000map leaf, size 10: @1F → @2B
3E9C 67656E65726174 6564txt "generated"
4802 00000000000000 00i64 0
510F 0A 3E000000 4800 0000map leaf, size 10: @3E → @48
5B5C 6661637473txt "facts"
6102 04000000000000 00i64 4
6A0F 0A 5B000000 6100 0000map leaf, size 10: @5B → @61
7407 16 01620000 1500 0000 34000000 5100 0000 6A000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A

Values from the query

A target's whole body can come from the query: {?e ?body} takes an object of fields, or null, from the row binding ?body. A key can also come from the query: in {?e {?field value}} the text bound to ?field names the field. These bound values are data, not evaluated again.

TRON289 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0042C 3F65txt "?e"
0076C 3F6669656C64txt "?field"
00E0E 11 00 0300 020000 00 04000000 070000 00array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @7
01F2C 3F65txt "?e"
0224C 6E616D65txt "name"
0272C 4379txt "Cy"
02A0E 15 00 0700 030000 00 1F000000 220000 00 27000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @1F → @22 → @27
03F2C 6966txt "if"
04209bit true
0434C 62616E64txt "band"
04800nil
0490E 19 00 0F00 040000 00 3F000000 420000 00 43000000 480000 00array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @3F → @42 → @43 → @48
0626C 3F6669656C64txt "?field"
0690E 11 00 0300 020000 00 49000000 620000 00array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @49 → @62
07A0E 11 00 0300 020000 00 2A000000 690000 00array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @2A → @69
08B5C 7768657265txt "where"
0910F 0A 8B000000 7A00 0000map leaf, size 10: @8B → @7A
09B4C 66696E64txt "find"
0A00F 0A 9B000000 0E00 0000map leaf, size 10: @9B → @E
0AA07 0E 0A000000 9100 0000 A0000000map branch, size 14, depth 0 (root), slots 1, 3: @91 → @A0
0B86C 3F6669656C64txt "?field"
0BF00nil
0C00F 0A B8000000 BF00 0000map leaf, size 10: @B8 → @BF
0CA2C 3F65txt "?e"
0CD0F 0A CA000000 C000 0000map leaf, size 10: @CA → @C0
0D75C 7175657279txt "query"
0DD0F 0A D7000000 AA00 0000map leaf, size 10: @D7 → @AA
0E75C 7061746368txt "patch"
0ED0F 0A E7000000 CD00 0000map leaf, size 10: @E7 → @CD
0F707 0E 40020000 DD00 0000 ED000000map branch, size 14, depth 2, slots 6, 9: @DD → @ED
10507 0A 01000000 F700 0000map branch, size 10, depth 1, slots 0: @F7
10F07 0A 80000000 0501 0000map branch, size 10, depth 0 (root), slots 7: @105
TRON146 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 436F6D6D697474 6564txt "Committed"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1FBC 7472616E736163 74696F6Etxt "transaction"
2B02 0B000000000000 00i64 11
340F 0A 1F000000 2B00 0000map leaf, size 10: @1F → @2B
3E9C 67656E65726174 6564txt "generated"
4802 00000000000000 00i64 0
510F 0A 3E000000 4800 0000map leaf, size 10: @3E → @48
5B5C 6661637473txt "facts"
6102 01000000000000 00i64 1
6A0F 0A 5B000000 6100 0000map leaf, size 10: @5B → @61
7407 16 01620000 1500 0000 34000000 5100 0000 6A000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A

Delete an entity

A null body deletes each selected data entity, as a null entity does in a patch. Stardust refuses to delete a definition or an object, and rejects a patch that deletes an entity and also writes a value to it.

TRON199 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
042C 3F65txt "?e"
070E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
142C 3F65txt "?e"
174C 6E616D65txt "name"
1C3C 457665txt "Eve"
200E 15 00 0700 030000 00 14000000 170000 00 1C000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @14 → @17 → @1C
350E 0D 00 0100 010000 00 20000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @20
425C 7768657265txt "where"
480F 0A 42000000 3500 0000map leaf, size 10: @42 → @35
524C 66696E64txt "find"
570F 0A 52000000 0700 0000map leaf, size 10: @52 → @7
6107 0E 0A000000 4800 0000 57000000map branch, size 14, depth 0 (root), slots 1, 3: @48 → @57
6F2C 3F65txt "?e"
7200nil
730F 0A 6F000000 7200 0000map leaf, size 10: @6F → @72
7D5C 7175657279txt "query"
830F 0A 7D000000 6100 0000map leaf, size 10: @7D → @61
8D5C 7061746368txt "patch"
930F 0A 8D000000 7300 0000map leaf, size 10: @8D → @73
9D07 0E 40020000 8300 0000 93000000map branch, size 14, depth 2, slots 6, 9: @83 → @93
AB07 0A 01000000 9D00 0000map branch, size 10, depth 1, slots 0: @9D
B507 0A 80000000 AB00 0000map branch, size 10, depth 0 (root), slots 7: @AB
TRON146 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 436F6D6D697474 6564txt "Committed"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1FBC 7472616E736163 74696F6Etxt "transaction"
2B02 0C000000000000 00i64 12
340F 0A 1F000000 2B00 0000map leaf, size 10: @1F → @2B
3E9C 67656E65726174 6564txt "generated"
4802 00000000000000 00i64 0
510F 0A 3E000000 4800 0000map leaf, size 10: @3E → @48
5B5C 6661637473txt "facts"
6102 04000000000000 00i64 4
6A0F 0A 5B000000 6100 0000map leaf, size 10: @5B → @61
7407 16 01620000 1500 0000 34000000 5100 0000 6A000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A

A computed patch

A list as the whole patch is an expression evaluated for each row. Its result is a patch in the forms above, or null for no change to that row. The result is data: its text values are not evaluated again, and it cannot write #_tx.

TRON296 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0042C 3F65txt "?e"
0075C 3F64657074txt "?dept"
00D0E 11 00 0300 020000 00 04000000 070000 00array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @7
01E2C 3F65txt "?e"
0214C 64657074txt "dept"
0265C 3F64657074txt "?dept"
02C0E 15 00 0700 030000 00 1E000000 210000 00 26000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @1E → @21 → @26
0410E 0D 00 0100 010000 00 2C000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @2C
04E5C 7768657265txt "where"
0540F 0A 4E000000 4100 0000map leaf, size 10: @4E → @41
05E4C 66696E64txt "find"
0630F 0A 5E000000 0D00 0000map leaf, size 10: @5E → @D
06D07 0E 0A000000 5400 0000 63000000map branch, size 14, depth 0 (root), slots 1, 3: @54 → @63
07B1C 3Dtxt "="
07D5C 3F64657074txt "?dept"
0835C 73616C6573txt "sales"
0890E 15 00 0700 030000 00 7B000000 7D0000 00 83000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @7B → @7D → @83
09E6C 726567696F6Etxt "region"
0A54C 77657374txt "west"
0AA0F 0A 9E000000 A500 0000map leaf, size 10: @9E → @A5
0B42C 3F65txt "?e"
0B70F 0A B4000000 AA00 0000map leaf, size 10: @B4 → @AA
0C12C 6966txt "if"
0C400nil
0C50E 19 00 0F00 040000 00 C1000000 890000 00 B7000000 C40000 00array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @C1 → @89 → @B7 → @C4
0DE5C 7175657279txt "query"
0E40F 0A DE000000 6D00 0000map leaf, size 10: @DE → @6D
0EE5C 7061746368txt "patch"
0F40F 0A EE000000 C500 0000map leaf, size 10: @EE → @C5
0FE07 0E 40020000 E400 0000 F4000000map branch, size 14, depth 2, slots 6, 9: @E4 → @F4
10C07 0A 01000000 FE00 0000map branch, size 10, depth 1, slots 0: @FE
11607 0A 80000000 0C01 0000map branch, size 10, depth 0 (root), slots 7: @10C
TRON146 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 436F6D6D697474 6564txt "Committed"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1FBC 7472616E736163 74696F6Etxt "transaction"
2B02 0D000000000000 00i64 13
340F 0A 1F000000 2B00 0000map leaf, size 10: @1F → @2B
3E9C 67656E65726174 6564txt "generated"
4802 00000000000000 00i64 0
510F 0A 3E000000 4800 0000map leaf, size 10: @3E → @48
5B5C 6661637473txt "facts"
6102 02000000000000 00i64 2
6A0F 0A 5B000000 6100 0000map leaf, size 10: @5B → @61
7407 16 01620000 1500 0000 34000000 5100 0000 6A000000map branch, size 22, depth 0 (root), slots 0, 9, 13, 14: @15 → @34 → @51 → @6A

Run it

mutation run.