replaceData()
Replace document data field contents.
Description
The replaceData()
method replaces all data fields with object.
Fields not present in object are removed unless their value is null
.
Examples
Given the following document:
{
"id": "365648872630911009",
"coll": "Books",
"ts": "2023-05-24T23:01:49.870Z",
"name": "Then and Now",
"author": "W. Somerset Maugham",
"data": {
"data": "007571098",
"update": "fix typo"
}
}
The following request replaces the data field elements:
{
id: "365648872630911009",
coll: Books,
ts: Time("2023-05-24T23:03:13.450Z"),
data: {
update: "verified"
}
}
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!