Replies: 3 comments 3 replies
-
Hi @webdastur , I'm quoting from the documentation, nodejs/javascript: TO REMOVE ( https://surrealdb.com/docs/integration/libraries/nodejs#delete ): // Delete all records from a table
await db.delete('person');
// Delete a specific record from a table
await db.delete('person:h5wxrf2ewk8xjxosxtyc'); TO RENAME ( https://surrealdb.com/docs/integration/libraries/nodejs#modify ): // Update all records in a table
let people = await db.modify('person', [
{ op: "replace", path: "/created_at", value: new Date() },
]);
// Update a record with a specific ID
let person = await db.modify('person:tobie', [
{ op: "replace", path: "/settings/active", value: false },
{ op: "add", "path": "/tags", "value": ["developer", "engineer"] },
{ op: "remove", "path": "/temp" },
]); Please take a deeper look into the docs and see if it helps you! |
Beta Was this translation helpful? Give feedback.
2 replies
-
@webdastur I haven't figured out renaming however deleting a field appears to be as easy as setting it to none
|
Beta Was this translation helpful? Give feedback.
1 reply
-
@tobiemh I need your help, please! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Remove/Rename a Field from Schemaless Table?
Beta Was this translation helpful? Give feedback.
All reactions