replace()
Replace all document fields.
Description
The replace()
method replaces all fields with object, except
for the immutable metadata fields id
, coll
, and ts
. Fields not
present in object, except immutable metadata fields, are removed
from the document.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
object |
Yes |
Object with the replacement document fields. |
Examples
Create and replace a document:
{
id: "346366070088532480",
coll: Character,
ts: Time("2022-10-24T02:41:15.130Z"),
name: "Princess Eilonwy",
age: 12,
attributes: [
"brave",
"cynical",
"talkative"
]
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!