Postgre JSONB Array


### append
```typeUPDATE jsontestingSET jsondata = jsondata || '["newString"]'::jsonbWHERE id = 7;```
### remove
```typeUPDATE jsontestingSET jsondata = jsondata - "newString"WHERE id = 7;```
### nested append
```typeUPDATE jsontestingSET jsondata = jsonb_set(  jsondata::jsonb,  array['nestedfield'],  (jsondata->'nestedfield')::jsonb || '["newString"]'::jsonb) WHERE id = 7;```
### Splice by index
```typeUPDATE ${table}    SET ${col} = ${col} - (      SELECT i      FROM generate_series(0, jsonb_array_length(${col}) - 1) AS i      WHERE (${col}->i->'id' = '"${id}"')    )WHERE ${table}.id = '${where}'::uuid```


### Splice by index of object array
> [https://itectec.com/database/postgresql-delete-an-object-from-within-an-array-using-jsonb-in-postgresql/](https://itectec.com/database/postgresql-delete-an-object-from-within-an-array-using-jsonb-in-postgresql/)

### Append and remove simple
> [Appending (pushing) and removing from a JSON array in PostgreSQL 9.5+](https://stackoverflow.com/questions/42233542/appending-pushing-and-removing-from-a-json-array-in-postgresql-9-5)






