Open this example in the interactive library
Source code
SELECT json_remove('["a","b","c","d"]','$[3]','$[1]') AS kept;
Sample output
[
{
"kept": "[\"a\",\"c\"]"
}
]
Remove two positions without index drift using SQLite JSON functions.
Open this example in the interactive library
SELECT json_remove('["a","b","c","d"]','$[3]','$[1]') AS kept;
[
{
"kept": "[\"a\",\"c\"]"
}
]