Remove
Remove(Ref,TS, Action)
Remove(Ref, TS, Action)
Remove(Ref, TS, Action)
Remove(Ref, TS, Action)
remove(Ref, TS, Action)
remove(Ref, TS, Action)
Remove(Ref, TS, Action)
Remove(Ref, TS, Action)
Description
The Remove
function deletes an event from an instance’s history. The
reference must refer to an instance of a user-defined class.
Outstanding references result in an "invalid argument" error.
Parameters
Argument | Type | Definition and Requirements |
---|---|---|
|
Reference |
A reference type containing the instance that should be removed. |
|
Long |
The time when the instance’s history should be modified. Can be expressed as either a number of UNIX microseconds or as a time value. |
|
Instance Action |
The type of action (create, delete, update) to be modified. |
Returns
An object containing the metadata of the remove
operations.
Field Name | Field Type | Definition and Requirements |
---|---|---|
|
Reference |
The reference which identifies the instance updated. |
|
Object |
A copy of the new instance data. |
|
Long |
The timestamp associated with the removal of the data. |
Examples
The query below changes the history for an instance in the "spells" class. The create event at timestamp 1 is removed.
curl https://db.fauna.com/ \
-u fnAChGwBcAACAO70ziE0cfROosNJHdgBmJU1PgpL: \
-d '{
"remove": { "@ref": "classes/spells/181388642581742080" },
"ts": 1,
"action": "create"
}'
client.Query(
Remove(
Ref("classes/spells/181388642581742080"),
ts: 1,
action: "create"));
System.out.println(
client.query(
Remove(
Ref(Class("spells"), Value(181388642581742080L)),
Value(1),
Action.CREATE
)
).get());
result, _ := client.Query(
f.Remove(
f.RefClass(f.Class("spells"), "181388642581742080"),
1,
f.ActionCreate,
),
)
fmt.Println(result)
client.query(
Remove(
Ref("classes/spells/181388642581742080"),
ts = 1,
action = "create"))
client.query(
q.remove(
Ref("classes/spells/181388642581742080"),
ts=1,
action="create"
))
$client.query do
remove ref('classes/spells/181388642581742080'), 1, 'create'
end
client.query(
Remove(
ref: Ref("classes/spells/181388642581742080"),
ts: 1,
action: "create"
)
)
client.query(q.Remove(q.Ref(q.Class("spells"), "181388642581742080"), 1, "create"))
.then((ret) => console.log(ret))
HTTP/1.1 200 OK
{ "resource": null }
null
null
{}
null
null
null
null
null
Was this article helpful?
We're sorry to hear that.
Tell us how we can improve!
documentation@fauna.com
Thank you for your feedback!