Delete prop on a object field when it is null #1579
Answered
by
tobiemh
calebeaires
asked this question in
Q&A
-
Given this row CREATE person:someId SET metadata = {
interest_level: 83.67,
information: {
age: 23,
gender: 'm',
},
marketing: true
}; I would like to "delete" a prop inside a object schema doing so: UPDATE person:someId SET information.gender = null SurrealDB update the object an set the information.gender nullable, but my primary intention where to "delete the prop". What SurrealDB do {
interest_level: 83.67,
information: {
age: 23,
gender: null,
},
marketing: true
} But this is the need: {
interest_level: 83.67,
information: {
age: 23
},
marketing: true
} |
Beta Was this translation helpful? Give feedback.
Answered by
tobiemh
Jan 6, 2023
Replies: 1 comment
-
Hi @calebeaires you can set the field to UPDATE person:someId SET information.gender = NONE; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tobiemh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @calebeaires you can set the field to
NONE
to delete it entirely...